Re: [racket] newbie string handling problem

2011-03-31 Thread Charles Hixson
Thanks. Regular expressions *isn't* what I wanted. (When I've tried them before [in Python] they made Python seem fast.) On 03/31/2011 05:06 PM, Thomas Chust wrote: 2011/4/1 Charles Hixson: [...] I'm trying to determine whether the last non-whitespace character of a string is a colon, an

Re: [racket] newbie string handling problem

2011-03-31 Thread Phil Bewig
; lnic -- last non-white is colon (define (lnic? s) ; explode to list (let loop ((cs (reverse (string->list s (cond ((null? cs) #f) ((char-whitespace? (car cs)) (loop (cdr cs))) (else (char=? (car cs) #\:) (define (lnic? s) ; index into string (let loop ((i (-

Re: [racket] newbie string handling problem

2011-03-31 Thread Matthias Felleisen
Here is what people are talking about when they say do it w/o regular expressions: #lang racket (require srfi/13) (define (ends-in-: s) (define t (string-trim-right s)) (and (> (string-length t) 0) (char=? (string-ref t (- (string-length t) 1)) #\:))) (ends-in-: "abc") (ends-in-: " abc

Re: [racket] newbie string handling problem

2011-03-31 Thread Neil Van Dyke
Eli Barzilay wrote at 03/31/2011 07:46 PM: Two minutes ago, Charles Hixson wrote: Hi, I'm trying to determine whether the last non-whitespace character of a string is a colon, (define (last-non-ws str) (cond [(regexp-match #px"(\\S)\\s*$" " \t") => cadr] [else #f])) then

Re: [racket] Creating Windows GUI App

2011-03-31 Thread Robby Findler
DrRacket? The games contain some smaller examples. There is also the Guide (in the documentation), which contains some examples (not apps per se). Robby On Thu, Mar 31, 2011 at 3:16 PM, Steve Graham wrote: > Is there an example of a Windows app which uses typical GUI elements - > window, text f

Re: [racket] newbie string handling problem

2011-03-31 Thread Thomas Chust
2011/4/1 Charles Hixson : > [...] > I'm trying to determine whether the last non-whitespace character of a > string is a colon, and I haven't been able to figure out the best way of > doing this.  In python I'd just trim the string and look at the character > before the end, > [...] Hello, well,

Re: [racket] Scribble change, especially affects `scribble/sigplan'

2011-03-31 Thread David Bremner
On Thu, 31 Mar 2011 07:58:47 -0400, Eli Barzilay wrote: > An hour ago, Matthew Flatt wrote: > > No. We have permission from CUP and SIGPLAN to distribute the style > > files, so we need to add something that indicates our license to > > distribute them. > > IIUC, the problem is more than just all

[racket] Creating Windows GUI App

2011-03-31 Thread Steve Graham
Is there an example of a Windows app which uses typical GUI elements - window, text field/area, radio button, drop down list, etc? Thanks, Steve_ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users

Re: [racket] newbie string handling problem

2011-03-31 Thread Eli Barzilay
Two minutes ago, Charles Hixson wrote: > Hi, I'm trying to determine whether the last non-whitespace > character of a string is a colon, and I haven't been able to figure > out the best way of doing this. In python I'd just trim the string > and look at the character before the end, but while Rack

Re: [racket] newbie string handling problem

2011-03-31 Thread Carl Eastlund
On Thu, Mar 31, 2011 at 7:38 PM, Charles Hixson wrote: > Hi, > I'm trying to determine whether the last non-whitespace character of a > string is a colon, and I haven't been able to figure out the best way of > doing this.  In python I'd just trim the string and look at the character > before the

[racket] newbie string handling problem

2011-03-31 Thread Charles Hixson
Hi, I'm trying to determine whether the last non-whitespace character of a string is a colon, and I haven't been able to figure out the best way of doing this. In python I'd just trim the string and look at the character before the end, but while Racket seems to have a string-length function,

Re: [racket] Invisible Canvas question

2011-03-31 Thread Eduardo Bellani
Thanks Matthew for the prompt reply. Just noticed the dot and the part in the docs referring to the geometry management. On 03/31/2011 05:58 PM, Matthew Flatt wrote: > A plain `panel%' doesn't perform any geometry management of its > children, and so `invisible-canvas' isn't moved and resized to f

Re: [racket] Invisible Canvas question

2011-03-31 Thread Matthew Flatt
A plain `panel%' doesn't perform any geometry management of its children, and so `invisible-canvas' isn't moved and resized to fill the frame. On my screen, I can see a little white dot where the canvas is 1 pixel by 1 pixel. Normally, you want either `vertical-panel%' or `horizontal-panel%', or y

[racket] Invisible Canvas question

2011-03-31 Thread Eduardo Bellani
Could someone please explain why there is an invisible canvas in this example? Env: Linux 2.6.31-23-generic Ubuntu i686 GNU/Linux racket 5.1.0.4 #lang racket (require racket/gui) (define bitmap-canvas% (class canvas% (init-field [bitmap #f]) (inherit get-dc) (define/override (on-p

Re: [racket] eval question

2011-03-31 Thread Eli Barzilay
About a minute ago, prad wrote: > if i run the last line in the repl, it works. > however, if i just try to run the program i the following error: > > compile: unbound identifier (and no #%app syntax transformer is bound) > at: display in: (display phr) > > so it seems that it doesn't recognize t

[racket] eval question

2011-03-31 Thread prad
i'm trying to get a string to execute as a function. #!/usr/bin/env racket #lang racket (define phr "THIS IS A PHRASE") (define x "(display phr)") (eval (read (open-input-string x))) if i run the last line in the repl, it works. however, if i just try to run the program i the followin

Re: [racket] Metadata idea

2011-03-31 Thread Jukka Tuominen
Second thought - to avoid any special system definitions, you could achieve the same results as follows... (define meta '((tooltip "This is a tooltip"); plain text (manual (fetch-manual-chapter 'object-x)); Rich-text format (self-test 'object-x); associated test cases

[racket] TFP2011: last CFP

2011-03-31 Thread Robby Findler
*         LAST CALL FOR PAPERS and CALL FOR PARTICIPATION                 12th International Symposium              Trends in Functional Programming 2011                         Madrid, Spain                        May 16-18, 2011            

Re: [racket] Scribble change, especially affects `scribble/sigplan'

2011-03-31 Thread Eli Barzilay
An hour ago, Matthew Flatt wrote: > At Wed, 30 Mar 2011 22:41:20 -0400, Eli Barzilay wrote: > > Going back to the copyright issues -- is this a good time to get > > rid of the two offending latex files? > > No. We have permission from CUP and SIGPLAN to distribute the style > files, so we need to

[racket] Metadata idea

2011-03-31 Thread Jukka Tuominen
Hi, I've been thinking of adding the following metadata 'feature' to Liitin, but I wonder if this could be of more generic use. What do you think about the idea? (meta ((tooltip "This is a tooltip"); plain text (manual (fetch-manual-chapter 'object-x)); Rich-text format (self-test

Re: [racket] Scribble change, especially affects `scribble/sigplan'

2011-03-31 Thread Matthew Flatt
At Wed, 30 Mar 2011 22:41:20 -0400, Eli Barzilay wrote: > Going back to the copyright issues -- is this a good time to get rid > of the two offending latex files? No. We have permission from CUP and SIGPLAN to distribute the style files, so we need to add something that indicates our license to di