Le 03/07/2015 22:18, Stephen Chang a écrit :
I think the call to "values" is misplaced.
Yes it does not work, it was just to show the idea of what I wanted.

Here's a functioning version of foo, and a perhaps more concise alternative:

(define (foo . L)
   (let ([bar (string-join (build-list (length L) (λ (x) "~a")) "")])
     (apply format bar L)))
Hmm, i didn't know we can use apply like this.. , I need to learn more about this function. This is exactly what i'm looking for ! .


(define (my-foo . L)
   (string-join (map ~a L) ""))
Of course it must the best way, but I have different kind of situation where I have this problem, so my code was just an example.

Thanks you :)


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to