Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
newbie in deep over his head
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 50 of 59 - Collapse all  -  Translate all to Translated (View all originals) < Older  Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alain Picard  
View profile  
 More options Mar 1 2002, 6:30 am
Newsgroups: comp.lang.lisp
From: Alain Picard <apic...@optushome.com.au>
Date: 01 Mar 2002 22:26:29 +1100
Local: Fri, Mar 1 2002 6:26 am
Subject: Re: newbie in deep over his head

Erik Naggum <e...@naggum.net> writes:
>   I think using #'(lambda ...) is a notational grossity.

Why do you say that?  Is that because you think (function (lambda ..))
looks worse, or because that's what the (lambda ..) macro is there for?

I'm curious, because I never thought of #'(lambda ..) as ugly.  I just
get used to seeing that #' everywhere I expect a function argument.

--
It would be difficult to construe        Larry Wall, in  article
this as a feature.                       <1995May29.062427.3...@netlabs.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nils Goesche  
View profile  
 More options Mar 1 2002, 6:45 am
Newsgroups: comp.lang.lisp
From: Nils Goesche <car...@cartan.de>
Date: 1 Mar 2002 11:45:56 GMT
Local: Fri, Mar 1 2002 6:45 am
Subject: Re: newbie in deep over his head

In article <868z9c5y1m....@gondolin.local.net>, Alain Picard wrote:
> Erik Naggum <e...@naggum.net> writes:

>>   I think using #'(lambda ...) is a notational grossity.

> Why do you say that?  Is that because you think (function (lambda ..))
> looks worse, or because that's what the (lambda ..) macro is there for?

> I'm curious, because I never thought of #'(lambda ..) as ugly.  I just
> get used to seeing that #' everywhere I expect a function argument.

I remember that I disliked #'(lambda ...) from the very first time I
saw it.  To me, (lambda ...) looks like something that evaluates
to a /function/, not to a symbol whose value slot would be taken
if I left out the #'.  I took me a long time, too, to find out that
it can actually be omitted (I think it was Erik who told me) because
lambda is also a macro.  I was very happy about that.  I had written
a curry macro, and didn't understand why #'(curry ...) wouldn't work
but (curry ...) would :-)

Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x42B32FC9


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Mar 1 2002, 8:16 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: Fri, 01 Mar 2002 13:12:05 GMT
Local: Fri, Mar 1 2002 8:12 am
Subject: Re: newbie in deep over his head
* Erik Naggum

> I think using #'(lambda ...) is a notational grossity.

* Alain Picard
| Why do you say that?  Is that because you think (function (lambda ..))
| looks worse, or because that's what the (lambda ..) macro is there for?

  It is because I consider #' a notational grossity in general, but it is a
  _functional_ notational grossity.  (Is "grossity" even a word?  Hm, no,
  but it should have been, because of "curiosity".)  (Also pardon the pun.)

  I think (function car) is notationally better than #'car, but I think
  'car is notationally better than (quote car).  Why?  I have no idea.
  Some twisted sense of aesthetics or something, I guess, or maybe I am
  just used to ', maybe it is so small it is innocuous, whereas #' looks
  like Laurel and Hardy or something.  Therefore, (function (lambda ...))
  is better than #'(lambda ...), but since that is such a redundancy, I
  much prefer (lambda ...) by itself.

| I'm curious, because I never thought of #'(lambda ..) as ugly.  I just
| get used to seeing that #' everywhere I expect a function argument.

  But that would obviously make it problematic to use a function that
  returns a function.  I think of lambda as a function-constructor, whereas
  function is a function-getter.  (function (lambda ...)) would therefore
  get at the function that lambda constructs.  (Yes, I do know that it is
  function that makes the lambda form into a function.)  Another function
  or look-alike that returns a function would be similarly unquoted.

///
--
  In a fight against something, the fight has value, victory has none.
  In a fight for something, the fight is a loss, victory merely relief.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Mar 1 2002, 8:16 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Fri, 1 Mar 2002 13:12:30 GMT
Local: Fri, Mar 1 2002 8:12 am
Subject: Re: newbie in deep over his head

It's probably a matter of historical effect, but I find #'foo and
#'(lambda ...) to be more aesthetic, not less.

First, it makes it easier to find the head of the function.

Second, it is more consistent to me because it means functions as data
are all case-marked by #'.  I was taught that #' was followed by a function
name, and that (lambda ...) was the name of a function.

Third, I was raised to not think of LAMBDA as a primitive special form,
so I look at LAMBDA as something that will not evaluate at all, and #'
as something that rescues it. ;)  It used to be that you could use either
(quote (lambda ...)) or (function (lambda ...)), with the main difference
being that the former didn't get the lexical environment (but then, mostly
we had only specials back then, so that wasn't very different).  #' was
a modified form of quote in its early casting, and # was like a modifier on
quote that said "functionally quote" rather than "evaluationally quote",
if you like.

[Then again, when I first tried to standardize the term "special form"
 (I'm doubt I invented it, but I think I first published about it), it
 meant what we now mean by "special form or macro" (that is, anything
 that wasn't a normal functional form).  Under that old terminology,
 you could say that LAMBDA now _is_ a special form; but under the
 modern terminology, not by my choice, there is no abstract term for
 that union set, and consequently you have to identify LAMBDA as a
 macro, not a special form, and thus still neither really "primitive"
 nor even ambiguously "maybe primitive maybe not".  Pity.  The community
 might wish to employ such ambiguity now in order to transition LAMBDA to
 a higher status, but there's really no good lingo for doing that.
 Maybe that's my fault for not adding yet another glossary word for people
 to cling to, though, while I had the chance.]

And, fourth, my preference for #' is partly due to the fact that while I do
quite a lot of #'(lambda...), I still don't think of myself as doing
functional programming.  I consider the use of functions as data an
unusual enough event that I don't mind case-marking it.  

I don't really mind the modern day (LAMBDA...) and I understand why people
want it, but I think it primarily a "comfort" matter for people who come
from a different culture.  I don't think it's a cut and dried matter for
which a coherent objective case can be made, even though I often observe
people trying.

What I find funny in all of this is that this is all about "highlighting"
and one of the problems I have with highlighting is that it does not vary
during the editing process.  That is, one puts #'(lambda...) and it is
highlit there WHETHER OR NOT the function it is highlighting is in my
"activity focus".  In a sense, it's always blinking in my peripheral
vision.  "Right!" I can hear you haters of "#'" saying, "that's why I
don't like it."  But those very same people will tell me they love
syntax highlighting.  I find it quite a lot more offensive to see every
keyword in purple (or whatever) and every string in brown and so on just
because I may not be caring about comments or keywords.  I definitely am
annoyed to see editors highlight the definition name in a function even
when I'm not debugging anything that requires use of the name.  

I don't know a good solution to this, and maybe I'm not explaining it
well, but imagine an interface where both my eye and perhaps even my
train of thought was tracked.  So that when I was debugging args to
OPEN, suddenly the keyword args to _that_ function (and only that
function) would turn purple.  In such a situation, then I wouldn't
have peripheral vision effects, and I'd like coloring better.

I have grudgingly tried to train myself to live with colors because I think
most people like them, and because there are occasionally times that the
color tells me something important.  But I almost wish I could have an editor
that hid color and that had a command that would instantaneously enable
color when I was searching for something in particular...  

(I have similar problems with Unix ANSI-colored directory list, which
is always highlighting too many things, making it hard to find the one
kind of thing I want highlit.)

Anyway, the reason I mentioned all of this is that I find #'(lambda
...)  to be about an order of magnitude, maybe two, less obtrusive
than colorizing my entire screen, and yet people who are hugely
offended by the "#'" notation (to call attention to the promotion of a
"function name" from the function namespace to the variable namespace)
are usually quite happy and unoffended at the use of color to
simultaneously call attention to everything on the screen.  And my
real point is that I honestly believe this matter to be considerably
more subjective than people are acknowledging.

Incidentally, I can't entirely clear my buffer on this topic without also
mentioning the bug in Dylan that was replicated from Common Lisp design over
my objections.  (Pretty much none of my suggestions were taken in Dylan,
so that's not big surprise.)  In particular, Common Lisp should have used
:optional, :rest, :key, etc. and _not_ &optional, &rest, &key, etc.  The
fact that & was chosen is unfortunate for a variety of reasons, not the
least of which is that these symbols have to be individually exported, plus
it makes the use of & in other contexts questionable.  A number of times,
good suggestions were made to extend Common Lisp that were rejected because
of the need to add "yet another &xxx keyword" but that I'm confident
would have been accepted trivially if it had been "adding yet another :xxx
keyword" because we're already used to having myriad :keywords.  Dylan
made #keywords to mirror CL's :keywords, but there was really no syntactic
need.  The argument was that people need to have their eye drawn to these
things.  My argument, by contrast is, "they need to find it when they need
to find it and not otherwise".  The issue of drawing one's eye could have
been handled in color if that really mattered, IMO, but I'd rather have
seen (... foo :optional (x 4) (y 7) :key ((:ex x) 3) ...)in CL or
... foo opt: x=4, y=7, key: ex:x=3 ... in Dylan.  We _did_ "fix" this in
ISLISP, where either &optional (as a transitional/compatibility notation)
or :optional can be used, etc.

Bottom line?  Programming language notations are statically required all
the time.  Focus issues are dynamically needed or not needed, so are not
always well addressed by static notation.  It's often a judgment call what
to emphasize and what not to in the static notation, and people often think
they're being a lot more principled than they are.  Mostly I don't see a lot
of science applied here at all.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Unicode (was Re: newbie in deep over his head)" by Daniel Barlow
Daniel Barlow  
View profile  
 More options Mar 1 2002, 8:16 am
Newsgroups: comp.lang.lisp
From: Daniel Barlow <d...@telent.net>
Date: 01 Mar 2002 01:41:54 +0000
Local: Thurs, Feb 28 2002 8:41 pm
Subject: Unicode (was Re: newbie in deep over his head)

David Golden <qnivq.tby...@bprnaserr.arg> writes:
> Could use unicode these days... which common lisp implementations
> are unicode-capable ?

There is a page on CLiki based on a post here by Bruno Haible, which
summarises Unicode support in clisp, eclipse, acl and lispworks.
It's out of date (of course) but it might give you a place to start

   http://ww.telent.net/cliki/Unicode%20Support

> I know Perl now supports unicode identifiers

Ran out of single characters for variable names, did they?

-dan

--

  http://ww.telent.net/cliki/ - Link farm for free CL-on-Unix resources


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Common syntax [was: newbie in deep over his head]" by Erik Naggum
Erik Naggum  
View profile  
 More options Mar 1 2002, 8:41 am
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: Fri, 01 Mar 2002 13:41:35 GMT
Local: Fri, Mar 1 2002 8:41 am
Subject: Re: Common syntax [was: newbie in deep over his head]
* Christopher C. Stacy
| People already complain about parenthesis because it makes things look
| different from most programming languages.  Now you're going to tell them
| (or let them mistakenly assume) that they need special characters in
| order to use Lisp?

  Well, it might get their attention off the parentheses.  :)

  Besides, one of the perceived problems with the parentheses, is that they
  are basically the only syntax you have, and some people seem to get lost
  in the homogeneous syntax.  So it _might_ actually help...

///
--
  In a fight against something, the fight has value, victory has none.
  In a fight for something, the fight is a loss, victory merely relief.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "newbie in deep over his head" by Nils Goesche
Nils Goesche  
View profile  
 More options Mar 1 2002, 9:15 am
Newsgroups: comp.lang.lisp
From: Nils Goesche <car...@cartan.de>
Date: 1 Mar 2002 14:15:37 GMT
Local: Fri, Mar 1 2002 9:15 am
Subject: Re: newbie in deep over his head

I am not sure if that was clear: I have nothing against #'car,
only against #'(lambda ...), because if #'blark is a function
that returns another function I do (funcall (blark ...) ...); then,
(funcall (lambda ...) ...) looks more visually consistent, doesn't it?
It doesn't, of course, if you think of (lambda ...) as the ``name''
of a function, as you say, but that sounds really foreign to me :-)
Indeed a cultural matter, it seems.

Interesting.  I love syntax coloring just as much as I violently
hate ``ls --color''...

How about ``ls -F''?  Does that look fine to you?

> Bottom line?  Programming language notations are statically required
> all the time.  Focus issues are dynamically needed or not needed,
> so are not always well addressed by static notation.  It's often
> a judgment call what to emphasize and what not to in the static
> notation, and people often think they're being a lot more principled
> than they are.  Mostly I don't see a lot of science applied here
> at all.

Sure, it is pretty clear that this is all about aesthetics.  Trying
to have a rigorous discussion about this seems as futile to me as,
say, wondering about what kind of being the ``it'' in ``it is
rainy'' is :-)

Regards,
--
Nils Goesche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x42B32FC9


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Common syntax [was: newbie in deep over his head]" by Kent M Pitman
Kent M Pitman  
View profile  
 More options Mar 1 2002, 9:19 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Fri, 1 Mar 2002 14:17:54 GMT
Local: Fri, Mar 1 2002 9:17 am
Subject: Re: Common syntax [was: newbie in deep over his head]

Erik Naggum <e...@naggum.net> writes:
> * Christopher C. Stacy
> | People already complain about parenthesis because it makes things look
> | different from most programming languages.  Now you're going to tell them
> | (or let them mistakenly assume) that they need special characters in
> | order to use Lisp?

>   Well, it might get their attention off the parentheses.  :)

>   Besides, one of the perceived problems with the parentheses, is that they
>   are basically the only syntax you have, and some people seem to get lost
>   in the homogeneous syntax.  So it _might_ actually help...

Allowing people to use {}'s and []'s interchangeably with ()'s might help more.

Or allowing {...} to mean (PROGN ...) so that you had
 (if x
     { (print x) (print y) }
     { (print z) })
But then, people can already do this so trivially, and it's so controversial
to do it globally (meaning, for all people), that it will never be adopted
as a standard.  But I don't know why people can't just insert the two
lines of code it takes to reorganize the lisp reader this way.  

With a couple more lines of work, the pretty printer can be made to display
things back this way, too.

Would that other languages had such flexible syntax redefinition...

But then, the real problem with using notations like this is that they
are opaque as to structure.  It's not that you can't write a macro
that destructures a PROGN, but if it looks like {...}, you might not
realize it's a PROGN, and that becomes a barrier to your writing
macros.  Lisp, by constantly exposing you to the parsed notation,
prepares you to write macros because the stuff of macro arguments is
so easily predictable from having seen it everywhere right in front of
you forever.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Unicode (was Re: newbie in deep over his head)" by Tim Bradshaw
Tim Bradshaw  
View profile  
 More options Mar 1 2002, 9:34 am
Newsgroups: comp.lang.lisp
From: Tim Bradshaw <t...@cley.com>
Date: 01 Mar 2002 14:09:40 +0000
Local: Fri, Mar 1 2002 9:09 am
Subject: Re: Unicode (was Re: newbie in deep over his head)

* Daniel Barlow wrote:
> Ran out of single characters for variable names, did they?

That can't be it.  The Perl Way would be to have only a small finite
number of identifiers but to have an elaborate, ill-explained and
buggy notion of `context' which causes them to mean subtly, or
occasionally completely, different things.  A large space of
single-character identifiers would be seen as a positive disadvantage.

Now the MS C++ people are going to love unicode variable names,
because they will be able to pack the whole naming convention
(hungarian naming?) into *single characters*.  Studies have shown[1]
that there is no significant loss of readability with this technique.

--tim

Footnotes:
[1]  I asked my cat


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "newbie in deep over his head" by Kenny Tilton
Kenny Tilton  
View profile  
 More options Mar 1 2002, 10:39 am
Newsgroups: comp.lang.lisp
From: Kenny Tilton <ktil...@nyc.rr.com>
Date: Fri, 01 Mar 2002 15:38:21 GMT
Local: Fri, Mar 1 2002 10:38 am
Subject: Re: newbie in deep over his head
I like (lambda...) more than #'(lambda...) because double-clicking the
latter leaves the #' behind.

--

 kenny tilton
 clinisys, inc
 ---------------------------------------------------------------
 "Be the ball...be the ball...you're not being the ball, Danny."
                                               - Ty, Caddy Shack


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Common syntax [was: newbie in deep over his head]" by Erik Winkels
Erik Winkels  
View profile  
 More options Mar 1 2002, 11:08 am
Newsgroups: comp.lang.lisp
From: Erik Winkels <aeri...@xs4all.nl>
Date: 01 Mar 2002 17:04:12 +0100
Local: Fri, Mar 1 2002 11:04 am
Subject: Re: Common syntax [was: newbie in deep over his head]
Kent M Pitman <pit...@world.std.com> wrote on Fri, 1 Mar 2002 14:17:54 GMT:

> But I don't know why people can't just insert the two lines of code
> it takes to reorganize the lisp reader this way.

Isn't that mostly because they are newbies and are not aware of it
being possible?  (For which I'm glad.)

Most other people stop worrying about importing the syntactic sugar
from their previous, and more familiar, languages once they are used
to Lisp.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "newbie in deep over his head" by Lieven Marchand
Lieven Marchand  
View profile  
 More options Mar 1 2002, 11:13 am
Newsgroups: comp.lang.lisp
From: Lieven Marchand <m...@wyrd.be>
Date: 28 Feb 2002 21:56:00 +0100
Subject: Re: newbie in deep over his head
Frode Vatvedt Fjeld <fro...@acm.org> writes:

> I don't think it can be reasonably argued that either reader macro
> version is so valuable as to outveigh their costs, which are firstly
> to take up one macro character, and secondly to be non-standard.

Actually, I find that these two arguments apply so often, that I've
never felt a shortage of available macro characters. About the only
one I use regularly is, in code that does a lot of lexer like actions,
a #L"string" that expands to (#\s #\t #\r #\i #\n #\g) for use in
calls to member, as character-bag etc. But then to use it in case
constructs, I need to write #.#L"foo" which I find is a bit too
obscure.

So, what are people using reader macro's for?

--
Lieven Marchand <m...@wyrd.be>
She says, "Honey, you're a Bastard of great proportion."
He says, "Darling, I plead guilty to that sin."
Cowboy Junkies -- A few simple words


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Common syntax [was: newbie in deep over his head]" by Glenn Burnside
Glenn Burnside  
View profile  
 More options Mar 1 2002, 12:39 pm
Newsgroups: comp.lang.lisp
From: "Glenn Burnside" <glenn.burns...@ni.com>
Date: Fri, 1 Mar 2002 11:39:07 -0600
Local: Fri, Mar 1 2002 12:39 pm
Subject: Re: Common syntax [was: newbie in deep over his head]
For the immediate case at hand (lambda seems bulky), you're right - I am
just looking for some sugar.  But obviously a little sugar is good - else
why '#... for function, or ' for list?  Do you tink you could get by without
that?  I don't think the motivation here is to import syntax from another
language, just to find some simpler ways of expressing things.  If I wrote a
lot of  progn's, {} might be a nice, simple alternative for me.  But I
wouldn't want other people viewing my code to see that - I'd want them to
see the progn.  Likewise for my suggested lambda hack.  This is going into
stream of consciousness mode, so bear with me.  What if you had a Lisp
environment that let you elevate the read macro kind of thing into the
editor - where the editor let you specify how you want to view and type
certain things, but the source file stored the actual forms?  Would that be
worth anything?

GB

"Erik Winkels" <aeri...@xs4all.nl> wrote in message

news:87zo1s1dhf.fsf@xs4all.nl...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "newbie in deep over his head" by Dorai Sitaram
Dorai Sitaram  
View profile  
 More options Mar 1 2002, 12:59 pm
Newsgroups: comp.lang.lisp
From: d...@goldshoe.gte.com (Dorai Sitaram)
Date: 1 Mar 2002 17:59:24 GMT
Local: Fri, Mar 1 2002 12:59 pm
Subject: Re: newbie in deep over his head
In article <sfw3czkl9dt....@shell01.TheWorld.com>,
Kent M Pitman  <pit...@world.std.com> wrote:

>What I find funny in all of this is that this is all about "highlighting"
>and one of the problems I have with highlighting is that it does not vary
>during the editing process.  That is, one puts #'(lambda...) and it is
>highlit there WHETHER OR NOT the function it is highlighting is in my
>"activity focus".  In a sense, it's always blinking in my peripheral
>vision.  "Right!" I can hear you haters of "#'" saying, "that's why I
>don't like it."  But those very same people will tell me they love
>syntax highlighting.  I find it quite a lot more offensive to see every
>keyword in purple (or whatever) and every string in brown and so on just
>because I may not be caring about comments or keywords.  I definitely am
>annoyed to see editors highlight the definition name in a function even
>when I'm not debugging anything that requires use of the name.  

Syntax-highlighting is always optional.  #' is forever.

--d


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Common syntax [was: newbie in deep over his head]" by Coby Beck
Coby Beck  
View profile  
 More options Mar 1 2002, 2:06 pm
Newsgroups: comp.lang.lisp
From: "Coby Beck" <cb...@mercury.bc.ca>
Date: Fri, 01 Mar 2002 19:06:38 GMT
Local: Fri, Mar 1 2002 2:06 pm
Subject: Re: Common syntax [was: newbie in deep over his head]

"Glenn Burnside" <glenn.burns...@ni.com> wrote in message

news:u7vf5tpbe9q38e@corp.supernews.com...

> For the immediate case at hand (lambda seems bulky), you're right - I am
> just looking for some sugar.  But obviously a little sugar is good - else
> why '#... for function, or ' for list?

this may have just been a mental typo, but <'> is <QUOTE>, not <LIST> - very
different.

--
Coby Beck
(remove #\Space "coby 101 @ bigpond . com")


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rahul Jain  
View profile  
 More options Mar 1 2002, 2:30 pm
Newsgroups: comp.lang.lisp
From: Rahul Jain <rj...@sid-1129.sid.rice.edu>
Date: 01 Mar 2002 13:26:34 -0600
Local: Fri, Mar 1 2002 2:26 pm
Subject: Re: Common syntax [was: newbie in deep over his head]

"Glenn Burnside" <glenn.burns...@ni.com> writes:
> What if you had a Lisp environment that let you elevate the read
> macro kind of thing into the editor - where the editor let you
> specify how you want to view and type certain things, but the source
> file stored the actual forms?  Would that be worth anything?

This is a long-term goal of my DefDoc (f.k.a. LambdaTeX) project. A
structured source editor that would automagically reindent all code to
your constraints about line-breaking, line-size, visual markup,
etc. The reason I think it's a good sub-project of a document layout
application is that the layout of the code is similar to layout of
text on paper, just with different ideas of what can be changed to
satisfy the layout constraints.

--
-> -/-                       - Rahul Jain -                       -\- <-
-> -\- http://linux.rice.edu/~rahul -=-  mailto:rj...@techie.com  -/- <-
-> -/- "I never could get the hang of Thursdays." - HHGTTG by DNA -\- <-
|--|--------|--------------|----|-------------|------|---------|-----|-|
   Version 11.423.999.221020101.23.50110101.042
   (c)1996-2002, All rights reserved. Disclaimer available upon request.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Naggum  
View profile  
 More options Mar 1 2002, 2:49 pm
Newsgroups: comp.lang.lisp
From: Erik Naggum <e...@naggum.net>
Date: Fri, 01 Mar 2002 19:49:00 GMT
Subject: Re: Common syntax [was: newbie in deep over his head]
* "Glenn Burnside" <glenn.burns...@ni.com>
| But obviously a little sugar is good - else why '#... for function, or '
| for list?

  One of the things I hope you will appreciate here is that people take
  some pains to be as precise as they can when they post, and that means
  that '# instead of #' is an annoyance.  ' does not mean list, it means
  quote.  'x does _not_ do the same as (list x), but (quote x).

| Do you think you could get by without that?

  You mean would I abstain from defining them if I wanted them?  No.  :)

| What if you had a Lisp environment that let you elevate the read macro
| kind of thing into the editor - where the editor let you specify how you
| want to view and type certain things, but the source file stored the
| actual forms?  Would that be worth anything?

  If you are not familiar with Emacs, yet, now is a good time to start.

///
--
  In a fight against something, the fight has value, victory has none.
  In a fight for something, the fight is a loss, victory merely relief.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "newbie in deep over his head" by Martin Simmons
Martin Simmons  
View profile  
 More options Mar 1 2002, 4:11 pm
Newsgroups: comp.lang.lisp
From: "Martin Simmons" <zne...@xanalys.com>
Date: Fri, 1 Mar 2002 21:11:07 -0000
Local: Fri, Mar 1 2002 4:11 pm
Subject: Re: newbie in deep over his head
"Glenn Burnside" <glenn.burns...@ni.com> wrote in message

news:u7sqcbe7snu32f@corp.supernews.com...

Slightly OT, but I sometimes prefer to use FLET instead of LAMBDA, because it
can help make the code self-documenting by giving the function a sensible name.
--
Martin Simmons, Xanalys Software Tools
zne...@xanalys.com
rot13 to reply

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Common syntax [was: newbie in deep over his head]" by Martin Simmons
Martin Simmons  
View profile  
 More options Mar 1 2002, 4:16 pm
Newsgroups: comp.lang.lisp
From: "Martin Simmons" <zne...@xanalys.com>
Date: Fri, 1 Mar 2002 21:15:50 -0000
Local: Fri, Mar 1 2002 4:15 pm
Subject: Re: Common syntax [was: newbie in deep over his head]
"Glenn Burnside" <glenn.burns...@ni.com> wrote in message

news:u7vf5tpbe9q38e@corp.supernews.com...

> For the immediate case at hand (lambda seems bulky), you're right - I am
> just looking for some sugar.  But obviously a little sugar is good - else
> why '#... for function, or ' for list?  Do you tink you could get by without
> that?  I don't think the motivation here is to import syntax from another
> language, just to find some simpler ways of expressing things.  If I wrote a
> lot of  progn's, {} might be a nice, simple alternative for me.  But I
> wouldn't want other people viewing my code to see that - I'd want them to
> see the progn.  Likewise for my suggested lambda hack.  This is going into
> stream of consciousness mode, so bear with me.  What if you had a Lisp
> environment that let you elevate the read macro kind of thing into the
> editor - where the editor let you specify how you want to view and type
> certain things, but the source file stored the actual forms?  Would that be
> worth anything?

For some reason, this reminded me of the first Lisp I ever played with, where
the editor was a function that required you to walk over the conses in your
function definition using operations that were thin layers over CAR and
RPLACA...
--
Martin Simmons, Xanalys Software Tools
zne...@xanalys.com
rot13 to reply

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian P Templeton  
View profile  
 More options Mar 1 2002, 9:01 pm
Newsgroups: comp.lang.lisp
From: Brian P Templeton <b...@tunes.org>
Date: Sat, 02 Mar 2002 02:01:16 GMT
Local: Fri, Mar 1 2002 9:01 pm
Subject: Re: Common syntax [was: newbie in deep over his head]
cst...@theworld.com (Christopher C. Stacy) writes:

Heh. Someone just asked how to display LAMBDA as λ (the lambda
character) on comp.emacs, and I posted a short hack to do this. It
doesn't work particularly well, but it would be easy to extend to work
normally.

> Before I learned Lisp, APL was my favorite language, so I'm not
> personally adverse to using funny characters for programming.
> But I can assure you that it is not a big selling point when trying
> to get mainstream programmers to take a look at your language.

> People already complain about parenthesis because it makes things look
> different from most programming languages.  Now you're going to tell
> them (or let them mistakenly assume) that they need special characters
> in order to use Lisp?

Regards,
--
BPT <b...@tunes.org>                  /"\ ASCII Ribbon Campaign
backronym for Linux:                    \ / No HTML or RTF in mail
        Linux Is Not Unix                        X  No MS-Word in mail
Meme plague ;)   --------->          / \ Respect Open Standards

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "newbie in deep over his head" by Brian P Templeton
Brian P Templeton  
View profile  
 More options Mar 1 2002, 9:01 pm
Newsgroups: comp.lang.lisp
From: Brian P Templeton <b...@tunes.org>
Date: Sat, 02 Mar 2002 02:01:27 GMT
Local: Fri, Mar 1 2002 9:01 pm
Subject: Re: newbie in deep over his head

David Golden <qnivq.tby...@bprnaserr.arg> writes:
> Espen Vestre wrote:

>> (the cutest thing would have been to use the lambda letter, of course,
>> where were all the lispers when 7-bit ascii was designed? ;-)).

> Could use unicode these days... which common lisp implementations
> are unicode-capable ?

SBCL has Unicode support, I think, but not in the latest released
version.

> Then you just need a few of those keyboards with little lcd screens
> on every key so that you can find all the extra characters....

> I know Perl now supports unicode identifiers  (in an effort to allow for
> even more unreadable programs),  and Java sorta does (AFAIK you can run
> utf8 source thru native2ascii which changes all unicode chars to \uxxxx
> sequences before passing it to javac...which noone ever does...)

> --
> Don't eat yellow snow.

--
BPT <b...@tunes.org>                  /"\ ASCII Ribbon Campaign
backronym for Linux:                    \ / No HTML or RTF in mail
        Linux Is Not Unix                        X  No MS-Word in mail
Meme plague ;)   --------->          / \ Respect Open Standards

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alain Picard  
View profile  
 More options Mar 2 2002, 1:05 am
Newsgroups: comp.lang.lisp
From: Alain Picard <apic...@optushome.com.au>
Date: 02 Mar 2002 16:58:41 +1100
Local: Sat, Mar 2 2002 12:58 am
Subject: Re: newbie in deep over his head

Erik Naggum <e...@naggum.net> writes:

>   I think of lambda as a function-constructor, whereas
>   function is a function-getter.

I think that's probably the crux.  One of the lisp books (Winston?)
says lambda, in modern lisp, really should have been renamed
to MAKE-FUNCTION (or some such).

Then your point would be well taken:
renaming lambda to make-function, and the current function
to function-slot, we'd get:

(defun make-adder (n)
  (make-function (x)
     (+ x n)))

(mapcar (make-adder 3) my-list)  
(mapcar (function-slot some-symbol) my-list)
(mapcar (make-function (x) (+ 3 x)) my-list)

...

all of which looks fairly clean and symmetric.  Thanks.

--
It would be difficult to construe        Larry Wall, in  article
this as a feature.                       <1995May29.062427.3...@netlabs.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kent M Pitman  
View profile  
 More options Mar 2 2002, 1:59 am
Newsgroups: comp.lang.lisp
From: Kent M Pitman <pit...@world.std.com>
Date: Sat, 2 Mar 2002 06:58:11 GMT
Local: Sat, Mar 2 2002 1:58 am
Subject: Re: newbie in deep over his head

One of the reasons it's not done this way is that often functions don't have
to cons.  In this sense, they are a little like symbols.  You name them and
you mean "map the function that adds 3 to its arg over my-list" not
"make a function that adds 3 to its arg and then map it over my-list", just
as when you do (list 'a 3) you do not mean "make a symbol A and then make
a list containing that symbol and 3".

A very astute observation by Paul Robertson (who authored Robertson
Common Lisp, a CLTL that Symbolics licensed and adapted to become the
lesser-known Symbolics CLOE 386-based native Lisp product) made
privately to me one day in the hall, but something I periodically
repeat to this day because it struck me as so obvious and important
that he should have written it down, was that it was a shame, probably
in general but particularly for those with C mindset who obsess about
consing, that LAMBDA blurred two very different operations:

  (lambda (x) (+ x 3)) refers to a function that can be statically
  compiled and has no overhead to execute beyond that of a literal.
  That is, given (defun f () (lambda (x) (+ x 3))), you'll note that (f)
  is a non-consing function.

  (lambda (x) (+ x y)) refers to a closure that has a more complex operation,
  more like LIST.  When you do
    (defun f (y) (lambda (x) (+ x y)))
  you're doing something more like
    (defun f-helper (closure-storage x) (+ x (storage-ref closure-storage 0)))
  which can be statically compiled and then
    (defun f (y)
      (let ((storage (make-storage 1)))
        (setf (storage-ref storage 0) y)
        (make-closure #'f-helper storage)))

Paul suggested that if these two operations were different, such that
[I don't remember the names he used, if any, so I'll make some up]
(PROCEDURE (X) (+ X 3)) meant the first kind [non-consing] and
(CLOSURE (X) (+ X 3)) meant hte second kind [closing/consing], then compilers
could be an error rather than do unwanted capture; that is, it's easy to
write (LAMBDA (X) (+ X Y)) not realizing you're doing capture, but if you
did (PROCEDURE (X) (+ X Y)) the compiler could stop you dead in your tracks,
while if you did (CLOSURE (X) (+ X Y)) the compiler would assume you knew
what you were up to.

Note there's still some opportunity to lose a little in
 (CLOSURE (X) (+ X Y Z))
because in hairy code, you might have thought Z wasn't a
capture even though you expected Y to be, and maybe
 (CLOSURE-OVER (Y) (X) (+ X Y Z))
would catch that.  But that's a detail, by comparison.

It is an issue of the difference between Common Lisp and C that what
we say is "this is what I want" not "this is how to implement what I
want", but Paul's formulation was nice because one could just always
use CLOSURE and sometimes be pleasantly surprised that it didn't cons.
(Maybe one could make it "complain" if nothing got captured, but
probably that would turn out to be annoying in the case of degenerate
macros.)  So there's some question as to whether it's dictating
implementation or just saying "this establishes a conceptual space".

The functional programming community, in general, prefers to blur these two
notations because both describe functions.  But compiler writers are VERY
familiar with the difference, and no one who becomes a writer of good code
in CL fails to understand the distinction between these two things.  So it's
quite bizarre, in a way, that we map them to one function.

It reminds me a little of the absolute nightmare I had when translating
Symbolics Macsyma from MACLISP to Common Lisp back in 1986 and trying to
accomodate QUOTIENT. MACLISP's QUOTIENT had the awful property that if you
gave it only integers, it did truncating divide.  But if you gave it any
arg that was a flonum (the MACLISP name for float), it did floating point
division instead.  So (QUOTIENT 3 2) => 1, but (QUOTIENT 3.0 2) => 1.5.
Obviously, some of these had to be translated to / in CL and others to
TRUNCATE. Figuring which was which, since they were all called QUOTIENT.
If you step back from Lisp, and functional languages in general, you can see
how LAMBDA would have this same kind of nightmarish ambiguity to some who
really cared about what it was "doing" ...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Timothy M. Schaeffer  
View profile  
 More options Mar 2 2002, 2:50 am
Newsgroups: comp.lang.lisp
From: "Timothy M. Schaeffer" <tsch...@erinet.com>
Date: Sat, 2 Mar 2002 02:46:05 -0500
Local: Sat, Mar 2 2002 2:46 am
Subject: Re: newbie in deep over his head

The following is extracted from the iterate package.  It creates a #L syntax
for creating functions, and automatically creates variables !1 !2 by finding
them in the definition and creating the lambda list automatically e.g.

(defun create-let (&rest vals)
    `(let ,(mapcar #L(list !1 !2)
                           (make-gensym-list (length vals)) vals)))

The function created by #L automatically takes two arguments which replace
!1 and !2. A numeric argument indicates exactly how many arguments there
should be, in case it is different from that indicated by the 'bang'
variables.

I thought it was kinda neat.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;
;;;
;;; SharpL.

(eval-when (compile load eval)

(defvar *old-sharpL-func* (get-dispatch-macro-character #\# #\L))

(set-dispatch-macro-character #\# #\L 'sharpL-reader)

(defun sharpL-reader (stream subchar n-args)
  (declare (ignore subchar))
  (let* ((form (read stream t nil t))
  (bang-vars (sort (bang-vars form) #'< :key #'bang-var-num))
  (bang-var-nums (mapcar #'bang-var-num bang-vars))
  (max-bv-num (if bang-vars
    (reduce #'max bang-var-nums :initial-value 0)
    0)))
    (cond
     ((null n-args)
      (setq n-args max-bv-num))
     ((< n-args max-bv-num)
      (error "#L: digit-string ~d specifies too few arguments" n-args)))
    (let* ((bvars (let ((temp nil))
      (dotimes (i n-args (nreverse temp))
        (push (make-bang-var (1+ i)) temp))))
    (args (mapcar #'(lambda (x) (declare (ignore x)) (gensym))
    bvars))
    (ignores (set-difference bvars bang-vars))
    (decl (if ignores `(declare (ignore ,.ignores)) nil))
    (body (if (list-of-forms? form)
       (if decl (cons decl form) form)
       (if decl (list decl form) (list form))))
    (subbed-body (sublis (pairlis bvars args) body)))
      `#'(lambda ,args ,.subbed-body))))

(defun make-bang-var (n)
  (intern (format nil "!~d" n)))

(defun list-of-forms? (x)
  (and (listp x) (listp (car x))
       (not (eq (caar x) 'lambda))))

(defun bang-vars (form)
  (delete-duplicates (bang-vars-1 form) :test #'eq))

(defun bang-vars-1 (form)
  (cond
   ((symbolp form)
    (if (bang-var? form)
 (list form)
 nil))
   ((atom form)
    nil)
   (t
    (nconc (bang-vars-1 (car form)) (bang-vars-1 (cdr form))))))

(defun bang-var? (sym)
  (char= (char (symbol-name sym) 0) #\!))

(defun bang-var-num (sym)
  (let ((num (read-from-string (subseq (symbol-name sym) 1))))
    (if (not (and (integerp num) (> num 0)))
 (error "#L: ~a is not a valid variable specifier" sym)
 num)))

) ;end eval-when


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Unicode (was Re: newbie in deep over his head)" by Paolo Amoroso
Paolo Amoroso  
View profile  
 More options Mar 2 2002, 6:04 am
Newsgroups: comp.lang.lisp
From: Paolo Amoroso <amor...@mclink.it>
Date: Sat, 02 Mar 2002 11:22:03 +0100
Local: Sat, Mar 2 2002 5:22 am
Subject: Re: Unicode (was Re: newbie in deep over his head)
On 01 Mar 2002 14:09:40 +0000, Tim Bradshaw <t...@cley.com> wrote:

> (hungarian naming?) into *single characters*.  Studies have shown[1]
> that there is no significant loss of readability with this technique.
[...]
> [1]  I asked my cat

That's unfair: cats see in the dark much better than humans.

Paolo
--
EncyCMUCLopedia * Extensive collection of CMU Common Lisp documentation
http://www.paoloamoroso.it/ency/README
[http://cvs2.cons.org:8000/cmucl/doc/EncyCMUCLopedia/]


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 26 - 50 of 59 < Older  Newer >
« Back to Discussions « Newer topic     Older topic »