(let (flet (multiple-value-bind (etc.)))) 
Author Message
 (let (flet (multiple-value-bind (etc.))))

I'm wondering about a more powerful version of let, to combine the
functionality of let, flet, multiple-value-bind, etc.  It seems like
it would be nice to be able to unfold the bindings into one long form
instead of deeply nesting them.  Does such a beast already lurk in
some dark corner of the universe, waiting for unwary adventurers to
discover it, or is this something I would have to create from scratch
to experiment with it?


Wed, 16 Jun 2004 22:18:16 GMT  
 (let (flet (multiple-value-bind (etc.))))

Quote:

> I'm wondering about a more powerful version of let, to combine the
> functionality of let, flet, multiple-value-bind, etc.  It seems like
> it would be nice to be able to unfold the bindings into one long form
> instead of deeply nesting them.  Does such a beast already lurk in
> some dark corner of the universe, waiting for unwary adventurers to
> discover it, or is this something I would have to create from scratch
> to experiment with it?

How on earth would you propose the syntax of such a horror to work?
The most reasonable syntax I can think of is:

  (et* ((a (foo))
         (#'b (x) (* x a))
         (c (b (bar)))
         ((values d d?) (gethash c *hash*)))
    ...)

But that is disgusting!  Maybe a multiple-value-let, like:

  (mv-let* ((a (foo))
            (b (bar a))
            ((c c?) (gethash b *hash*)))
    ...)

would be useful and readable.  Honestly, it's a very rare event when I
have to nest at all deeply because of switching between let, flet, and
m-v-bind.  In those cases (you're probably not going to like my
solution :) I just make my Emacs frame really big.  My lines aren't
any longer than normal, they just start significantly to the right of
normal.  Eww, to get either of these to work, your macro will have to
completely parse declarations so it can stick them to the correct
form.

--
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                              
   |     ) |                              
  (`-.  '--.)                              
   `. )----'                              



Thu, 17 Jun 2004 02:57:01 GMT  
 (let (flet (multiple-value-bind (etc.))))

Quote:

> I'm wondering about a more powerful version of let, to combine the
> functionality of let, flet, multiple-value-bind, etc.  It seems like
> it would be nice to be able to unfold the bindings into one long form
> instead of deeply nesting them.  Does such a beast already lurk in
> some dark corner of the universe, waiting for unwary adventurers to
> discover it, or is this something I would have to create from scratch
> to experiment with it?

It comes up fairly often in c.l.l. Google for LETBIND and friends.

--

She says, "Honey, you're a Bastard of great proportion."
He says, "Darling, I plead guilty to that sin."
Cowboy Junkies -- A few simple words



Thu, 17 Jun 2004 02:46:24 GMT  
 (let (flet (multiple-value-bind (etc.))))

| I'm wondering about a more powerful version of let, to combine the
| functionality of let, flet, multiple-value-bind, etc.

  There are about as many of these as there are Scheme implementations.
  However useful they seem before you start to write it, it is quickly
  abandoned because in fact it is not particularly useful -- instead of
  being written once and for all, you tinker with it so much there is never
  any actual savings, especially since every Common Lisp programmer you
  might want to share code with has his own version of such a macro.

///
--
  The past is not more important than the future, despite what your culture
  has taught you.  Your future observations, conclusions, and beliefs are
  more important to you than those in your past ever will be.  The world is
  changing so fast the balance between the past and the future has shifted.



Thu, 17 Jun 2004 05:00:12 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. multiple-value binding let and let*

2. let vs. multiple-value-bind

3. Final SRFI 8: RECEIVE: Binding to multiple values

4. SRFI 8: RECEIVE: Binding to multiple values

5. Defining multiple-values binding forms

6. MULTIPLE-VALUE-BIND question

7. binding multiple values (Ex: Re: some small proposed changes to standard)

8. lambda list in MULTIPLE-VALUE-BIND?

9. with-slots and multiple-value-bind

10. Common Lisp summary and multiple value binding

11. multiple-value-bind

12. Bind, dont Bind etc help please

 

 
Powered by phpBB® Forum Software