(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
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
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
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
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
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.
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
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
> 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))
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
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
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
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
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) ; -> (
14 matches
Mail list logo