Hi!
I am soon to start learning lisp.
Coming from a background in more modern (excuse the
expression) functional languages (SML, Caml, Gofer) I am hoping to
incorporate what I have learned there into my lisp programming.
So far I have discovered how to pass functions around, and how
to program higher-order functions, such as fold, map, zip etc.
However, my use of these ho-functions is limited since I can't
figure out how to pass around a partially evaluated function...
I'm wondering if I ought to concoct a compiler which would
allow me to write functions in a modern functional style, and have it
translate these functions into lisp - giving pattern matching,
currying, type checking etc. Then I could take these lisp code
fragments and incorporate them into a larger lisp structure, enabling
me to take advantage of all the wonderful features of lisp...
Alternatively, since (as I am told) lisp is an easily
extensible language, maybe I can create an _extension_ to lisp which
will incorporate features such as pattern matching... This certainly
looks easier and more flexible than the compiler option.
My point is, that I have no desire to go reinventing wheels;
does anyone have any ideas on this kind of thing? Has any work been
done on this issue? If so, please let me know!!!
--
Jeremy Gibbons <······@cs.aukuni.ac.nz> tel: +64 9 373 7599 x5120
Department of Computer Science, fax: +64 9 373 7453
University of Auckland, Private Bag 92019, Auckland, New Zealand.
Steve Wray <no.email.address.I.know.of>
Student at
University of Auckland
NewZealand
Paper mail to;
13 Bay Road, Palm Beach, Waiheke Island, Auckland.
In article <···················@cs7.cs.aukuni.ac.nz> ······@cs7.cs.aukuni.ac.nz (Stephen David Wray) writes:
> However, my use of these ho-functions is limited since I can't
>figure out how to pass around a partially evaluated function...
You'll have to curry it yourself (possibly using macros or your own
micro-compiler). If you also want lazy evaluation, you can wrap
#'(lambda () ...) around every argument and (funcall ...) around every
parameter instance.