Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Function call with a list of parameters
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Bruce Hoult <bruce@h...>
Subject: Re: [Caml-list] Function call with a list of parameters
At 10:54 AM -0800 12/12/01, Chris Hecker wrote:
>It does seem like there's an asymmetry in parameters versus return 
>values that might be worth looking into (in languages in general, 
>not just caml).  Bruce's example was interesting to me because I 
>didn't know that lisp had tuples (as opposed to just lists).  That 
>reintroduces the asymmetry that I'm talking about, where if 
>everything was just a list (both returns and params) then it would 
>be symmetric and apply would just work.  Even with tuples, lisp is 
>still more symmetric since you can convert a tuple to a list 
>generically and then pass it in with apply (according to Bruce's 
>example).
>
>I would assume people way more knowledgable than me have analyzed 
>the tradeoffs in the [a]symmetry before.  Assuming it's interesting 
>at all, which I don't know enough about languages to know that 
>either.  :)

This asymmetry was one of the motivating insights behind the design 
of Scheme in the late 1970's, and both Dylan and Common Lisp have to 
some extent followed it.

If you write programs in Continuation Passing Style (CPS) then there 
is no asymmetry between parameter passing and return value passing, 
and many Scheme (and *ML) compilers convert programs to CPS in the 
process of compilation.  Scheme provides constructs to allow the user 
to write a mix of CPS and normal code (call/cc) while CL and Dylan 
provide more explicit support for multiple return values.  Scheme 
recently added similar support.

-- Bruce
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr