Article View: comp.lang.misc
Article #4234Re: scheme [Re: What does an anti-perl look like]
From: Raul Rockwell
Date: Sat, 29 Jun 1991 02:34
Date: Sat, 29 Jun 1991 02:34
50 lines
2793 bytes
2793 bytes
Stephen E. Witham:
> Lisp has two features: an internal form for programs, and a
> (over:-) simple syntax. I think with an "infix Scheme,"
> having a well-defined internal form would give you most of the
> power. You'd need a "code-constant" or
> "internal-form-of-this-quoted-code-fragment" construct, e.g.,
> x = quote {
> function ( a, b ) {
> return a+b;
> }
> };
> (That's not a lambda expression, it's a quoted lambda expression.)
Raul Rockwell (me):
Requiring a lambda expression to express an anonymous function
seems to me to be one of LISP's flaws, not one of its advantages.
Mark Friedman:
What's your alternative? You need some syntax to say that you want
a function that takes some number of arguments.
Well, you can say that an infix function takes one or two arguments.
Make one argument optional (with greedy binding) and ambiguity may be
resolved when the function is used. e.g. x-y vs. -y
A less elegant solution might be to always require two arguments and
use BOTTOM a lot.
Me: Or, put another way, infix notation already has a clear scheme
for representing arguments, why not take advantage of it?
Mark Friedman:
I won't argue about the usefulness of infix notation, but what has
that to do with anonymous functions?
You can define anonymous functions using infix notation by either (a)
explicitly declaring dummy variables (similar to (lambda (x y) ...))
(b) using a pair of "standard names" for dummy variables, or (c)
tacitly defining functions without the use of any dummy variables
(just say what functions preprocess the arguments/postprocess the
results).
I expect you'd want a good variety of data-structure building
functions for something like this (otherwise you could only work with
"toy" data). [And a good variety of meta-functions for leverage.]
Or maybe I'm missing the point of the question??
--
Raul <rockwell@socrates.umd.edu>
Technical Details
Message-ID:
<ROCKWELL.91Jun28213445@socrates.umd.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!europa.asd.contel.com!gatech!udel!haven.umd.edu!socrates.umd.edu!socrates!rockwellReferences:
<4601@optima.cs.arizona.edu> <1991Jun26.223026.13792@watserv1.waterloo.edu> <603@smds.UUCP> <ROCKWELL.91Jun27233537@socrates.umd.edu> <MARKF.91Jun28103956@montreux.ai.mit.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!europa.asd.contel.com!gatech!udel!haven.umd.edu!socrates.umd.edu!socrates!rockwell From: rockwell@socrates.umd.edu (Raul Rockwell) Newsgroups: comp.lang.misc Subject: Re: scheme [Re: What does an anti-perl look like] Message-ID: <ROCKWELL.91Jun28213445@socrates.umd.edu> Date: 29 Jun 91 02:34:45 GMT References: <4601@optima.cs.arizona.edu> <1991Jun26.223026.13792@watserv1.waterloo.edu> <603@smds.UUCP> <ROCKWELL.91Jun27233537@socrates.umd.edu> <MARKF.91Jun28103956@montreux.ai.mit.edu> Sender: rockwell@socrates.umd.edu (Raul Rockwell) Organization: Traveller Lines: 50 In-Reply-To: markf@zurich.ai.mit.edu's message of 28 Jun 91 14: 39:56 GMT