Re: Experiment with named args

2009-07-17 Thread Mark Addleman
Chouser - Can you describe definline and how that differs from defmacro? I'm not sure I understand it from reading the docs. On Jul 17, 10:06 am, Chouser wrote: > On Fri, Jul 17, 2009 at 12:17 PM, Laurent PETIT > wrote: > > > 2009/7/17 Chouser > > >> On Fri, Jul 17, 2009 at 11:21 AM, Mark >

Re: Experiment with named args

2009-07-17 Thread Chouser
On Fri, Jul 17, 2009 at 12:17 PM, Laurent PETIT wrote: > > 2009/7/17 Chouser >> >> On Fri, Jul 17, 2009 at 11:21 AM, Mark >> Addleman wrote: >> > >> > On Jul 17, 2:35 am, Nicolas Oury wrote: >> >> Hello, >> >> >> >> Can this construct handle higher-order functions? >> > >> > Nope :) >> > >> > Ch

Re: Experiment with named args

2009-07-17 Thread Laurent PETIT
2009/7/17 Chouser > > On Fri, Jul 17, 2009 at 11:21 AM, Mark > Addleman wrote: > > > > On Jul 17, 2:35 am, Nicolas Oury wrote: > >> Hello, > >> > >> Can this construct handle higher-order functions? > > > > Nope :) > > > > Chouser brought up this point in IRC. It's not even clear what the > > s

Re: Experiment with named args

2009-07-17 Thread Laurent PETIT
Hi, 2009/7/17 Mark Addleman > > > > On Jul 16, 11:50 pm, Laurent PETIT wrote: > > 2009/7/17 Mark Addleman > > > > > > > > > "The "sufficiently smart compiler" argument > > > comes to mind: if the arglist of a function is known, then surely > > > the > > > compiler should be able to automatic

Re: Experiment with named args

2009-07-17 Thread Chouser
On Fri, Jul 17, 2009 at 11:21 AM, Mark Addleman wrote: > > On Jul 17, 2:35 am, Nicolas Oury wrote: >> Hello, >> >> Can this construct handle higher-order functions? > > Nope :) > > Chouser brought up this point in IRC.  It's not even clear what the > syntax would look like. I suppose you could p

Re: Experiment with named args

2009-07-17 Thread Mark Addleman
On Jul 17, 2:35 am, Nicolas Oury wrote: > Hello, > > Can this construct handle higher-order functions? Nope :) Chouser brought up this point in IRC. It's not even clear what the syntax would look like. > (I mean a function with named arguments as an argument to another > function). > It see

Re: Experiment with named args

2009-07-17 Thread Mark Addleman
On Jul 16, 11:50 pm, Laurent PETIT wrote: > 2009/7/17 Mark Addleman > > > > > "The "sufficiently smart compiler" argument > >  comes to mind: if the arglist of a function is known, then surely > > the > >  compiler should be able to automatically translate named/keyword > >  arguments into an

Re: Experiment with named args

2009-07-17 Thread Nicolas Oury
Hello, Can this construct handle higher-order functions? (I mean a function with named arguments as an argument to another function). It seems quite difficult to do a function dependent transformation on the call site when the function is unknown. Best regards, Nicolas. On Thu, 2009-07-16 at 1

Re: Experiment with named args

2009-07-16 Thread Laurent PETIT
2009/7/17 Mark Addleman > > "The "sufficiently smart compiler" argument > comes to mind: if the arglist of a function is known, then surely > the > compiler should be able to automatically translate named/keyword > arguments into an appropriate simple call?" > > That is exactly what motivated

Re: Experiment with named args

2009-07-16 Thread Laurent PETIT
Interesting ! BTW, I think you can simplify (eval `^(var ~fn)) into (meta (resolve fn)). Regards, -- Laurent 2009/7/17 Mark Addleman > > A few days ago, Chouser and I had a discussion on IRC about the > viability of named arguments (a la Smalltalk) for Clojure. In clojure- > contrib, there

Re: Experiment with named args

2009-07-16 Thread Mark Addleman
"The "sufficiently smart compiler" argument comes to mind: if the arglist of a function is known, then surely the compiler should be able to automatically translate named/keyword arguments into an appropriate simple call?" That is exactly what motivated me to write this macro. I was pretty su

Re: Experiment with named args

2009-07-16 Thread Richard Newman
> Even if the macro isn't all that valuable, I learned a lot > about Clojure in the process. If anyone has any suggestions, I'd love > to hear them. This is definitely interesting to me. I currently use the keyword arg idiom -- (apply hash-map args) -- but I'm painfully aware of all the addit