[plt-scheme] How do I convert (values ...) to something I can do something with?

From: Hugh Myers (hsmyers at gmail.com)
Date: Thu Mar 11 11:28:53 EST 2010

I on the other hand can barely tolerate '{' usage let alone additional
visual clutter. Parenthesis are all that I've ever needed for lists
etc...

--hsm

On Thu, Mar 11, 2010 at 7:59 AM,  <hendrik at topoi.pooq.com> wrote:
> On Thu, Mar 11, 2010 at 02:08:14PM +1300, Tony Garnock-Jones wrote:
>> Todd O'Bryan wrote:
>> > Stylistically, is one better/more idiomatic than the other? I thought
>> > about returning a list, but I have this aversion to complex nested
>> > structures that aren't self-descriptive.
>>
>> There's always the third option: explicit continuation-passing. I use
>> this style a lot, preferring it to both (values) and (list) almost
>> always, and over records occasionally.
>>
>> I think the combination of multiple-values and control over, um, control
>> is really nice:
>>
>>   (define (find-something haystack needle-spec k-found k-notfound)
>>     (cond
>>       ... (k-found needle something anotherthing)
>>       ... (k-notfound)
>>       ...))
>>
>>   (find-something my-haystack my-needle-spec
>>     (lambda (a b c) ...)
>>     (lambda () (error "oh dear")))
>>
>> However, (you (do (end (up (nesting (continuations (fairly (deeply
>> (sometimes))))))))).
>
> Which is why I'm getting on my old hobby-horse and somplaining again
> about Lisp's bracket syntax.  It's really useful to have a symbol (I've
> used '/' that indicates 'all the rest of this list is really a sublist'.
> Then you could have written
>
>> However, (you /do /end /up /nesting /continuations /fairly /deeply
>> /sometimes).
>
> -- hendrik
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>


Posted on the users mailing list.