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
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
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
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
> 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
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
> 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
> 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
> 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
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
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
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
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
> (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
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#@
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
>
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
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
18 matches
Mail list logo