[racket] R7RS public comment period

2012-02-14 Thread Marc Feeley
This message is being posted to various lists to inform members of the Scheme community on the development of R7RS. I am pleased to announce that the sixth draft version of R7RS ("small" language) has been completed by working group 1 and is now available at the following URL: http://trac.sac

Re: [racket] Dr. Racket goes Google?...

2012-02-14 Thread Todd O'Bryan
One of my favorites is the Halloween logo you get on October 31. On Tue, Feb 14, 2012 at 2:10 AM, Ashok Baktha wrote: > > No you are not hallucinating. I got the same heart based logo when using Dr > Racket. > > That is pretty cool! Thanks! > > > > On 14-Feb-2012, at 12:33, RĂ¼diger Asche wrote:

Re: [racket] Bouncing default value

2012-02-14 Thread Laurent
> > > (define default (gensym)) > > (define (default? x) (equal? x default)) > > (Using `eq?' here is a common idiom.) > ah, of course, thanks for the reminder. > > In any case, the real point here is not the macro -- it's the > existence of a special `none' value that marks an unsupplied value.

Re: [racket] Bouncing default value

2012-02-14 Thread Laurent
On Tue, Feb 14, 2012 at 17:45, Chongkai Zhu wrote: > I simply use > > (define (bar . x) > (apply foo 5 x)) > Yes, but that does not work if the specified optional argument is not the first one (and not the last one). That works if all default arguments are all keyword-based though (using keywor

Re: [racket] Bouncing default value

2012-02-14 Thread Chongkai Zhu
On 2/11/2012 10:55 AM, Laurent wrote: Hi, Often I'd like to make a wrapper for a given function that has default values (possibly with keywords). So if I want my function to have the same default values for one particular optional argument, I need to redefine it myself. For example, suppose

Re: [racket] Bouncing default value

2012-02-14 Thread Chongkai Zhu
On 2/11/2012 10:55 AM, Laurent wrote: Hi, Often I'd like to make a wrapper for a given function that has default values (possibly with keywords). So if I want my function to have the same default values for one particular optional argument, I need to redefine it myself. For example, suppose

Re: [racket] Making a Racket function "recallable"

2012-02-14 Thread Stephen Bloch
On Feb 14, 2012, at 12:18 AM, Erik Silkensen wrote: > Another option is you could turn change your fib function to be 'mk-fib' that > returns a new instance of the fib function each time it's called: > > (define (mk-fib) > (let ([n0 -1] [n1 1]) >(lambda () > (let ([next (+ n0 n1)]) >

Re: [racket] Making a Racket function "recallable"

2012-02-14 Thread Stephen Bloch
On Feb 13, 2012, at 11:52 PM, Joe Gilray wrote: > This function works, but is not "recallable" (is there a better word?). In > other words I cannot do the following: > > (define f1 fib) > (define f2 fib) > (f1) (f1) (f2) ... > > and have f1 and f2 be separate fibonacci lists. This is the imp

Re: [racket] Making a Racket function "recallable"

2012-02-14 Thread Stephen Bloch
On Feb 14, 2012, at 12:51 AM, Erik Silkensen wrote: > Instead of calling fib-less-than-n recursively, you could add a loop inside, > for example something like, > > (define (fib-less-than-n n) > (define fib (mk-fib)) > (let loop ([vs '()]) > (let ([fib-val (fib)]) > (if (>= fib-va

Re: [racket] Making a Racket function "recallable"

2012-02-14 Thread Erik Silkensen
Sure, sounds good. The (let loop ([vs '()]) ...) is a 'named let' (http://docs.racket-lang.org/guide/let.html?q=named%20let#(part._.Named_let)) which as the guide says is equivalent to (letrec ([loop (lambda (vs) ...)]) (loop '()) --- so 'loop' is a recursive function that we're using to iterat

[racket] Is the racket home page down for anyone else?

2012-02-14 Thread John Sampson
It has just told me that google.com is down, but it isn't. Regards _John Sampson_ On 13/02/2012 23:13, Neil Van Dyke wrote: BTW, this is useful site to know about: http://downforeveryoneorjustme.com/ Racket Users list: http://lists.racket-lang.org/users

Re: [racket] Making a Racket function "recallable"

2012-02-14 Thread Joe Gilray
Thanks Danny, Now I can use the original recursive formulation: ; function to use the fib-stream to generate a list of all fibs < n (define (fib-stream-less-than-n n) (let ([fib-val (stream-first fib-stream)]) (if (>= fib-val n) '() (cons fib-val (fib-less-than-n n) I've learned a lot

Re: [racket] Making a Racket function "recallable"

2012-02-14 Thread Joe Gilray
Thanks Erik. Very nice! Although I miss the recursion. please help me understand how this works, especially (let loop ([vs '()]). What exactly is going on there? Thanks again, -joe On Mon, Feb 13, 2012 at 9:51 PM, Erik Silkensen wrote: > Instead of calling fib-less-than-n recursively, you cou