Re: [racket] a question of style, and one of performance

2012-01-09 Thread Jordan Schatz
> Can you give an example of such a language? I'm curious. Unfortunately I forget which one, I recall that the reason given was that since the default value couldn't be determined at compile time the compiler was unable to optimize functions with such default arguments. Much of my work is in PHP,

Re: [racket] a question of style, and one of performance

2012-01-08 Thread Robby Findler
FWIW, arguments in Racket are always passed on a stack. Robby On Sun, Jan 8, 2012 at 9:12 PM, Gregory Woodhouse wrote: > I suppose it could prevent certain optimizations in parameter passing, > forcing space for arguments to be allocated on the heap. > > Sent from my iPad > > On Jan 8, 2012, at

Re: [racket] a question of style, and one of performance

2012-01-08 Thread Gregory Woodhouse
I suppose it could prevent certain optimizations in parameter passing, forcing space for arguments to be allocated on the heap. Sent from my iPad On Jan 8, 2012, at 12:42 PM, Danny Yoo wrote: > On Sun, Jan 8, 2012 at 3:23 PM, Jordan Schatz wrote: >> This code runs, but I'm guessing that its

Re: [racket] a question of style, and one of performance

2012-01-08 Thread Danny Yoo
On Sun, Jan 8, 2012 at 3:23 PM, Jordan Schatz wrote: > This code runs, but I'm guessing that its not the "right way" to do it. > > (define (js-date [i (current-date)]) >  (let ([original-format (date-display-format)] >        [return ((λ () >                     (date-display-format 'rfc2822) >  

Re: [racket] a question of style, and one of performance

2012-01-08 Thread Robby Findler
I think you want parameterize: (parameterize ([date-display-format 'rfc2822]) (date->string i #t)) In general: ((lambda () e1 e2 ...)) = (begin e1 e2 ...) fwiw. So that extra function there isn't going to help. Robby On Sun, Jan 8, 2012 at 2:23 PM, Jordan Schatz wrote: > This code runs,

[racket] a question of style, and one of performance

2012-01-08 Thread Jordan Schatz
This code runs, but I'm guessing that its not the "right way" to do it. (define (js-date [i (current-date)]) (let ([original-format (date-display-format)] [return ((λ () (date-display-format 'rfc2822) (date->string i #t)))]) (date-display-for