[racket] list->values

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Sat Sep 17 13:50:23 EDT 2011

On Sat, Sep 17, 2011 at 1:43 PM, Jeremy Kun <kun.jeremy at gmail.com> wrote:
> Is there a function that converts a list into a values expression which
> contains every element of the list?

(define (list->values xs)
  (apply values xs))

> I've run into a bit of trouble trying to
> implement something like it myself, and it's probably because I don't
> understand exactly how values is used (or supposed to be used).
> My use case is essentially to make my web-server templating code shorter by
> using let*-values and calling a lookup table to return a bunch of strings
> corresponding to which page I want to serve.

Consider using 'match' on the lists (if I understand you correctly).


> Jeremy
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.