[racket] Running Racket in the R6RS mode

2012-07-13 Thread Rouben Rostamian
Here is the entire contents of a file named tryme.rkt: ;;- #!r6rs (import (rnrs base) (rnrs sorting (6))) ;;- I start up racket from the command-line (non-gui) and type: (enter! "tryme.rkt") (list-sort < '(4 2 7 1)) ; note: list-so

Re: [racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Rouben Rostamian
Thank you all who responded to my question about possible improvements on my `all-lower-case?' function. I was surprised by the large variety of ways that it could be done and learned something new from each of the respondents. This is a very helpful mailing list. -- Rouben Rostamian orig

Re: [racket] Flatten syntax and runtime phases?

2012-07-13 Thread Matthias Felleisen
No apologies needed. I just wanted to warn you that some old-style Lispers will give you a hard time concerning 'hygiene' and I also wanted to give you an idea that they usually don't understand the full range of expressive power we get from it, not to speak of the conflation of pattern-matchin

Re: [racket] Flatten syntax and runtime phases?

2012-07-13 Thread Eli Barzilay
Three hours ago, Nick Sivo wrote: > > Heh -- this is very nice to hear, since Arc is supposed to be > > using macros in a way that highlights unhygienic macros... > > My take on it is that Arc's original macros were designed to be > powerful but simple. All you need to know in order to use them a

Re: [racket] Flatten syntax and runtime phases?

2012-07-13 Thread Nick Sivo
> You might have an extremely deep understanding of macros, in which case you > can ignore the next sentence. I don't, and apologize if I've been using the term (and others!) incorrectly. What little I know has come from the documentation and papers I've encountered, and lacks the rigor of academ

Re: [racket] Flatten syntax and runtime phases?

2012-07-13 Thread Matthias Felleisen
On Jul 13, 2012, at 2:05 PM, Nick Sivo wrote: > There were only a few places where breaking hygiene was a feature, You might have an extremely deep understanding of macros, in which case you can ignore the next sentence. Hygiene -- as it is used nowadays, not the thing for which I imported

Re: [racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Matthias Felleisen
> Welcome to Racket v5.3.0.14. > > (require lang/htdp-beginner) > > (string-lower-case? "ABC") > #f > > (string-lower-case? "aBC") > #f > > (string-lower-case? "abc") > #t http://pre.racket-lang.org/docs/html/htdp-langs/beginner.html#(def._htdp-beginner._((lib._lang/htdp-beginner..rkt)._string-up

Re: [racket] Flatten syntax and runtime phases?

2012-07-13 Thread Nick Sivo
> Heh -- this is very nice to hear, since Arc is supposed to be using > macros in a way that highlights unhygienic macros... My take on it is that Arc's original macros were designed to be powerful but simple. All you need to know in order to use them are the language primitives and any functions

Re: [racket] Getting a list of keys in specified order

2012-07-13 Thread Kieron Hardy
> Anyway, if you're dealing only with alists, you don't need to know about > "dict-keys" (whatever that is), just like you don't need to know about Justin > Bieber (whatever that is). I was stuck in the abstraction "Dictionary", thinking I might need more of the API than just dict-keys. As it t

Re: [racket] Compilation/create executable question

2012-07-13 Thread Jay McCarthy
On Fri, Jul 13, 2012 at 11:52 AM, Matt Jadud wrote: > Hi all, > > Danny and Jay put me on the right track with my last question, and > I've now hacked things together for a project that I'd like to share > with one or two other people so they can explore the hack as well. > Specifically, I want to

[racket] Compilation/create executable question

2012-07-13 Thread Matt Jadud
Hi all, Danny and Jay put me on the right track with my last question, and I've now hacked things together for a project that I'd like to share with one or two other people so they can explore the hack as well. Specifically, I want to find out if we're on the right track on multiple platforms, and

Re: [racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Ian Tegebo
On Fri, Jul 13, 2012 at 6:02 AM, Rouben Rostamian wrote: > (define (all-lower-case? str) > (not (memq #t > (map (lambda (i) > (if (and (char-alphabetic? i) (char-upper-case? i)) > #t #f)) > (string->list str) > > This l

Re: [racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Danny Yoo
On Fri, Jul 13, 2012 at 9:31 AM, Danny Yoo wrote: >> (define (all-lower-case? str) >> (not (memq #t >> (map (lambda (i) >> (if (and (char-alphabetic? i) (char-upper-case? i)) >> #t #f)) >> (string->list str) >> >> This

Re: [racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Danny Yoo
> (define (all-lower-case? str) > (not (memq #t > (map (lambda (i) > (if (and (char-alphabetic? i) (char-upper-case? i)) > #t #f)) > (string->list str) > > This looks rather clumsy to me. It's also named "all-lower-case

Re: [racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Stephen Bloch
On Jul 13, 2012, at 9:02 AM, Rouben Rostamian wrote: > The function `all-lower-case?' defined below takes a string and > returns #f if the string has at least one uppercase alphabetic > character, else returns #t. > > Examples: > (all-lower-case? "asdf12#@") => #t > (all-lower-case? "asDf12#@

Re: [racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Justin Zamora
You can use something like this: (define (all-lower-case? str) (string=? str (string-downcase str))) > (all-lower-case? "haha") #t > (all-lower-case? "haHa") #f Justin On Fri, Jul 13, 2012 at 9:02 AM, Rouben Rostamian wrote: > The function `all-lower-case?' defined below takes a string and >

Re: [racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Sam Tobin-Hochstadt
On Fri, Jul 13, 2012 at 9:02 AM, Rouben Rostamian wrote: > The function `all-lower-case?' defined below takes a string and > returns #f if the string has at least one uppercase alphabetic > character, else returns #t. Welcome to Racket v5.3.0.14. -> (define (all-lower-case? s) (for/and ([c s

[racket] This is too clumsy. Is there a better way?

2012-07-13 Thread Rouben Rostamian
The function `all-lower-case?' defined below takes a string and returns #f if the string has at least one uppercase alphabetic character, else returns #t. Examples: (all-lower-case? "asdf12#@") => #t (all-lower-case? "asDf12#@") => #f Here is how I have written it: (define (all-lower-case? s