Re: [racket-users] named let ...

2020-11-26 Thread George Neuner
On 11/26/2020 11:22 PM, Tim Meehan wrote: I was trying to turn one of Knuth's random number sampling without replacement algorithms. It seems to be working, but when it comes time to return my prize ... nothing :( I thought that since I was returning from inside of the named let, that I'd ge

[racket-users] named let ...

2020-11-26 Thread Tim Meehan
I was trying to turn one of Knuth's random number sampling without replacement algorithms. It seems to be working, but when it comes time to return my prize ... nothing :( I thought that since I was returning from inside of the named let, that I'd get back my collection of numbers sampled without

Re: [racket-users] Rosette: can it help me

2020-11-26 Thread Bertrand Augereau
Thank you very much for the fast and precise answer, I'll study this ! Le jeu. 26 nov. 2020 à 22:24, Sorawee Porncharoenwase a écrit : > > You are doing a recursion on a symbolic value, which is a common pitfall in > Rosette. > > See slide 81 and subsequent slides for more details. Slide 87 show

Re: [racket-users] Rosette: can it help me

2020-11-26 Thread Sorawee Porncharoenwase
You are doing a recursion on a symbolic value, which is a common pitfall in Rosette. See slide 81 and subsequent slides for more details. Slide 87 shows a solution to this problem. On Thu, Nov 26, 2020 at 1:12 PM Bertrand Augerea

[racket-users] Rosette: can it help me

2020-11-26 Thread Bertrand Augereau
Hello everybody, not sure if this is the good place to ask about this but I couldn't find a good location so I'm asking for help here, after all it's strongly connected to Racket :) I'm trying to reverse-engineer some specific piece of hardware with the help of Rosette, to discover if it can help

Re: [racket-users] snappier place startup time

2020-11-26 Thread nate
Awesome. Also I didn’t know you could include ‘#%place like that. Nate > On Nov 25, 2020, at 9:41 PM, Sam Tobin-Hochstadt wrote: > > Here's an in-progress PR: https://github.com/racket/racket/pull/3518 > > With this, your simple test takes about 150ms with `racket/place` and > 50ms with `rack

Re: [racket-users] Passing keywords from a list

2020-11-26 Thread Dimaugh Silvestris
Thanks! Your answer led me to find keyword-apply, so I just wrote (I use def as abbreviation for define): (def (parse-args xs) (def (fn ks kvs vs xs) (cond [(empty? xs) (map reverse (list ks kvs vs))] [(keyword? (car xs)) (fn (cons (car xs) ks) (cons (cadr xs) kvs) vs

Re: [racket-users] Passing keywords from a list

2020-11-26 Thread Sorawee Porncharoenwase
If you are OK with preprocessing the argument list into a dictionary, then you can use keyword-apply/dict . For example: #lang racket (require racket/dict)

[racket-users] Passing keywords from a list

2020-11-26 Thread Dimaugh Silvestris
Is it possible to reproduce this behavior ((lambda (#:color color #:size size) (display (cons color size))) #:color "red" #:size 3) when what I have is a list such as '(#:color "red" #:size 3) ? How can I feed keyword arguments stored in a list as symbols in a way that doesn't involve parsing man