Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] STM, the Silver Bullet, and the Foot



Curt Sampson writes:

 > Right. I'd not realized that 'special forms' were as special as they
 > are, but my complaint remains, unless I'm misunderstanding things here:
 > you need knowledge of the entire environment (closure) within which
 > you're operating to know if arguments will be evaluated or not. Am I
 > incorrect that in this example (no doubt with syntatical errors,

For Lispers I'll note that Curt is using a Scheme, aka Lisp1, dialect,
while I used a Lisp2.  For non-Lispers, the difference is that in
Lisp1, the head of a form to be evaluated is evaluated as a variable
and the result called as a function.  In Lisp2, the head of a form is
evaluated as a function, the function value being stored separately
from the variable value, and the result called as a function.  Ie, in
Lisp1, functions and variables share a single namespace while in Lisp2
they get separate namespaces.

 > think you'll get the gist of it)
 > 
 >     (let ((old-and and)) 
 >       (let ((and (lambda (x y) (old-and x y))))
 > 	(and #f launch-missiles)))
 > 
 > that the missiles will be launched, whereas in most contexts,
 > "(and #f launch-missiles)" will not launch them?

You want "(and #f (launch-missiles))", I think.[1]  With that caveat,
you are correct.  Anonymous functions specified with lambda are
ordinary functions, and all arguments are automatically evaluated
before the function body sees them.

 > >  > The advantage lies in Haskell, not in STM.
 > > 
 > > I'll buy that.  Caveat "or any pure functional language", of course.
 > > Haskell just happens to be the (deservedly) popular one at the moment.
 > 
 > I'm not sure it actually applies to all functional languages labeled
 > as "pure," actually;

I'm not either, to be sure.


Footnotes: 
[1]  I don't think there are any dialects of Lisp where variable
access has side-effects (though that would be a *wonderful* feature to
add to Intercal ... if it doesn't have it already, ESR is such a
pervect that he might have thought of it long ago).



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links