Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why don't you take a bit of time to read about multiple values in Common Lisp?

    CL-USER 76 > (nth-value 1 (values 'a 'b 'c 'd))
    B
While you are at it, check out the feature of 'Macros' in Lisp, which allows everyone to write code to shorten this stuff. See my code in this thread for a macro which then allows you to write:

    (multiple-value-bind-some (NIL b)
       (foo bar baz)
      b)
One then can name ignored variables as NIL in the source code...


Good point. And very true. Still looks a bit ugly to me, but it's better than nothing, I suppose. And yes, I am aware of macros. For some reason using them in this situation didn't occur to me, so I guess I am an idiot after all.

This is actually one of the cases where syntax-rules would allow you to write something cleaner, I would guess. I like syntax rules, but everybody always seems to complain about it...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: