[racket-users] Should compose be so slow?

2015-09-14 Thread Roman Klochkov
(define (f1 x) (+ x 1)) (define (f2 x) (+ x 2)) (define (f3 x) (+ x 3)) (define (f* x) (f1 (f2 (f3 x (define f-comp (compose f1 f2 f3)) (define-syntax-rule (test f) (time (for ([i (in-range 1)]) (f i (test f*) (test f-comp) --- cpu time: 375 real time: 375 gc time: 0

Re: [racket-users] Expression context

2015-09-14 Thread Jens Axel Søgaard
FWIW an alternative to (let () ...) is block. http://docs.racket-lang.org/reference/block.html?q=block 2015-09-15 0:16 GMT+02:00 John Carmack : > Is there a deep reason why defines aren’t allowed in the branches of an > if, but are for cond / while / unless? > > > > Wrapping code in (let() …) in

Re: [racket-users] Startup times

2015-09-14 Thread Matthew Flatt
Unfortunately, `raco make` may go wrong if its own implementation is not compiled. You probably want `raco setup` or (equivalently) `racket -l setup`, which should be fast if it's just a matter of updating file timestamps. At Mon, 14 Sep 2015 20:20:39 -0500, Robby Findler wrote: > If you run "rac

Re: [racket-users] Startup times

2015-09-14 Thread Robby Findler
If you run "raco make -v cmdline2.rkt" you will see output if .zo compilation is happening. Robby On Mon, Sep 14, 2015 at 8:16 PM, John Carmack wrote: > No strace on Android, unfortunately. > > > > From: Marc Burns [mailto:m4bu...@uwaterloo.ca] > Sent: Monday, September 14, 2015 8:10 PM > To: J

RE: [racket-users] Startup times

2015-09-14 Thread John Carmack
No strace on Android, unfortunately. From: Marc Burns [mailto:m4bu...@uwaterloo.ca] Sent: Monday, September 14, 2015 8:10 PM To: John Carmack Cc: Racket Users Subject: Re: [racket-users] Startup times Here’s the result of `strace -c -f -- racket -l racket/base` for Racket 6.1.1.8 on my Linux wor

Re: [racket-users] Startup times

2015-09-14 Thread Marc Burns
Here’s the result of `strace -c -f -- racket -l racket/base` for Racket 6.1.1.8 on my Linux workstation: % time seconds usecs/call callserrors syscall -- --- --- - - 99.080.004000 571 7 nanosleep 0.

Re: [racket-users] Startup times

2015-09-14 Thread Marc Burns
Set the environment variable PLTSTDERR=debug to get more verbose output. Startup involves traversing all the bytecode files that comprise the base environment. How fast is filesystem access on the Note 4 compared to PC? You could use strace to find the latency on different system calls made duri

[racket-users] Startup times

2015-09-14 Thread John Carmack
I am experimenting with running racket natively on Android to compare with my current embedded Chibi scheme implementation. It would be convenient to just leave racket as a separate process and communicate over sockets/pipes so it exactly mimics my remote development case. The startup time to

Re: [racket-users] Expression context

2015-09-14 Thread Leif Andersen
> Wrapping code in (let() …) instead of (begin …) works fine, but it is a strange quirk to explain to someone else. This is because begin actually does not create new scope in racket, where as (let () ...) does. Consider the following code: #lang racket (define (f x) (begin (define g 5))

Re: [racket-users] Expression context

2015-09-14 Thread Matthias Felleisen
On Sep 14, 2015, at 6:16 PM, John Carmack wrote: > Is there a deep reason why defines aren’t allowed in the branches of an if, > but are for cond / while / unless? > > Wrapping code in (let() …) instead of (begin …) works fine, but it is a > strange quirk to explain to someone else. It exp

[racket-users] Expression context

2015-09-14 Thread John Carmack
Is there a deep reason why defines aren't allowed in the branches of an if, but are for cond / while / unless? Wrapping code in (let() ...) instead of (begin ...) works fine, but it is a strange quirk to explain to someone else. -- You received this message because you are subscribed to the Go

RE: [racket-users] Procedure to save racket file as text file

2015-09-14 Thread Andre Mayers
It works. Thank you. -Message d'origine- De : Robby Findler [mailto:ro...@eecs.northwestern.edu] Envoyé : 13 septembre 2015 21:19 À : Andre Mayers Cc : Neil Van Dyke ; racket-users@googlegroups.com List Objet : Re: [racket-users] Procedure to save racket file as text file There are

RE: [racket-users] values considered harmful

2015-09-14 Thread Jos Koot
Please ignore my stupid remark. Trying the code of Benjamin Greenman in DrRacket, version 6.2.0.5--2015-07-06(d6fa581/a) [3m] I did not get a segfault but a correct error message. I did not realize that Benjamin Greenman was referring to a segfault. Sorry for the noise, Jos _ From: Jos Ko

RE: [racket-users] values considered harmful

2015-09-14 Thread Jos Koot
In the last line split&flip receives 0, but it needs a pair. The following wotks correct: #lang racket/base (define (split&flip xy) (define-values (x y) (values (car xy) (cdr xy))) (values y x)) ;; My mistake: x should be a pair (define-values (a b) (split&flip (cons 0 1))) (cons a b) ; -> (