From: JP Massar
Subject: The Last Lonely Lisp Link
Date: 
Message-ID: <ruogqvgkaq8at92hpk5posf4pst3b8qc52@4ax.com>
The Auckland University of Technology, dateline November 4, 2003.

He searches.  Further and further into the stacks at the AUT library.
At last, the familiar blue-green cover, images of 'Steele' and 'Lisp'
appear on his retina.

Amidst a sea of Java, an ocean of C++, the Last Lonely Lisp Link
awaits, perhaps for one last time, a human touch.

But I can not bring myself to actually take it off its shelf.  Looking
like it has not been touched since dinosaurs roamed New Zealand,
I fear for its very existence.

No worthwile companions do it honor.  No Norvig, no Graham, no Keene.
Its next-door neighbor a book on COBOL.   Ignominy.  Nothing but a
naked Steele.

He leaves the stacks and goes outside, where the stars are in strange
constellations.  And waits to cons another day.

From: Kenny Tilton
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <xO_pb.35073$Gq.9779962@twister.nyc.rr.com>
JP Massar wrote:
> The Auckland University of Technology, dateline November 4, 2003.
> 
> He searches.  Further and further into the stacks at the AUT library.
> At last, the familiar blue-green cover, images of 'Steele' and 'Lisp'
> appear on his retina.
> 
> Amidst a sea of Java, an ocean of C++, the Last Lonely Lisp Link
> awaits, perhaps for one last time, a human touch.
> 
> But I can not bring myself to actually take it off its shelf.  Looking
> like it has not been touched since dinosaurs roamed New Zealand,
> I fear for its very existence.
> 
> No worthwile companions do it honor.  No Norvig, no Graham, no Keene.
> Its next-door neighbor a book on COBOL.   Ignominy.

Nonsense. COBOL has loose typing and is the only language on Earth with 
a multiple-dispatch "cond", viz. EVALUATE. COND is why Lisp got created, 
so a little respect is due the langugae that took COND the furthest. I 
dare say COBOL is also the only language with MOVE-CORRESPONDING. Native 
ISAM, which come to think of it would not be a bad idea at all for a CL 
substandard. I am proud to have COBOL as my next-door alphabetic neighbor.

:)


-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Your Project Here! http://alu.cliki.net/Industry%20Application
From: Thomas F. Burdick
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <xcvsml31bnw.fsf@famine.OCF.Berkeley.EDU>
Kenny Tilton <·······@nyc.rr.com> writes:

> > No worthwile companions do it honor.  No Norvig, no Graham, no Keene.
> > Its next-door neighbor a book on COBOL.   Ignominy.
> 
> Nonsense. COBOL has loose typing and is the only language on Earth with 
> a multiple-dispatch "cond", viz. EVALUATE. COND is why Lisp got created, 
> so a little respect is due the langugae that took COND the furthest. I 
> dare say COBOL is also the only language with MOVE-CORRESPONDING. Native 
> ISAM, which come to think of it would not be a bad idea at all for a CL 
> substandard. I am proud to have COBOL as my next-door alphabetic neighbor.
> 
> :)

Lessee, Kenny auto-echoes on mentions of newbies ("Road to Lisp!"),
CLOS questions or general design questions ("Cells!"), John McCarthy
("Used My Laptop!"), and ... COBOL.  Bet he didn't see that one coming
:)

- Thomas, the local FORTRAN troll

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Kenny Tilton
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <kD7qb.62363$ri.10318370@twister.nyc.rr.com>
Thomas F. Burdick wrote:

> Kenny Tilton <·······@nyc.rr.com> writes:
> 
> 
>>>No worthwile companions do it honor.  No Norvig, no Graham, no Keene.
>>>Its next-door neighbor a book on COBOL.   Ignominy.
>>
>>Nonsense. COBOL has loose typing and is the only language on Earth with 
>>a multiple-dispatch "cond", viz. EVALUATE. COND is why Lisp got created, 
>>so a little respect is due the langugae that took COND the furthest. I 
>>dare say COBOL is also the only language with MOVE-CORRESPONDING. Native 
>>ISAM, which come to think of it would not be a bad idea at all for a CL 
>>substandard. I am proud to have COBOL as my next-door alphabetic neighbor.
>>
>>:)
> 
> 
> Lessee, Kenny auto-echoes on mentions of newbies ("Road to Lisp!"),
> CLOS questions or general design questions ("Cells!"), John McCarthy
> ("Used My Laptop!"), and ... COBOL.  Bet he didn't see that one coming
> :)
> 
> - Thomas, the local FORTRAN troll
> 

You forgot my RoboCup and algorithmic music composition drumbeats 
(speaking of which, I just found a drum instrument and will be playing 
with the Schillinger system all day), but really....

This is sad, so very, very sad. Here was a chance for a really cool 
thread about "how the hell can COND do multiple dispatch?" or "EVALUATE: 
COND on steroids", and all we get is an ad homineum flame from the 
leader of the Oakland Chapter of the Let's Kill Kenny Cabal.

When I saw I had a reply from a brilliant correspondent such as Burdick, 
  I scrolled down with eager anticipation expecting to learn of some 
other language capable of multile-dispatch COND or MOVE-CORRESPONDING, 
or dream of dreams, an open source portable CL ISAM.

Instead this. Sad, so sad.  <sigh> Please, next time, try to talk about 
programming.

:)

kenny

PS. So no other language does multi-dispatch cond? Cool. 
MOVE-CORRESPONDING is a little MIS-specific, but COND is what drove 
McCarthy into the mountains to create his own language, so that's a nice 
chunk of shared DNA.

-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Your Project Here! http://alu.cliki.net/Industry%20Application
From: Thomas F. Burdick
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <xcvptg61zw0.fsf@famine.OCF.Berkeley.EDU>
Kenny Tilton <·······@nyc.rr.com> writes:

> This is sad, so very, very sad. Here was a chance for a really cool 
> thread about "how the hell can COND do multiple dispatch?" or "EVALUATE: 
> COND on steroids", and all we get is an ad homineum flame from the 
> leader of the Oakland Chapter of the Let's Kill Kenny Cabal.

Okay, I'll bite; what's up with EVALUATE?  I was curious and STFineW
for MOVE-CORRESPONDING, but EVALUATE is a bit more difficult.  In
fact, trying again this morning, I'm still not getting mucbh that
makes sense (it looks like CASE to me, but I'm only getting hits on
tutorials)

> Instead this. Sad, so sad.  <sigh> Please, next time, try to talk about 
> programming.
> 
> :)

But when you're talking about something you're completely ignorant of
(me/cobol), ad-hominem is so much easier.  Speaking of which...

> McCarthy into the mountains to create his own language, so that's a nice 
  ^
  You missed one :)

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Kenny Tilton
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <YKbqb.62482$ri.10400412@twister.nyc.rr.com>
Thomas F. Burdick wrote:

> Kenny Tilton <·······@nyc.rr.com> writes:
> 
> 
>>This is sad, so very, very sad. Here was a chance for a really cool 
>>thread about "how the hell can COND do multiple dispatch?" or "EVALUATE: 
>>COND on steroids", and all we get is an ad homineum flame from the 
>>leader of the Oakland Chapter of the Let's Kill Kenny Cabal.
> 
> 
> Okay, I'll bite; what's up with EVALUATE? 

It's as if Lisp had:

  (defun attraction (make model year)
    (case make model year
      ((chevy vette ANY) 'vroom)
      ((jaguar ANY ANY) 'classy)
      ((porsche 928 (THRU 1950 1978)) 'classic)
      ((volkswagen FALSE ANY)))
      ((Ferrari TRUE ANY) 'chick-magnet)))

kt


-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Your Project Here! http://alu.cliki.net/Industry%20Application
From: Daniel Barlow
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <87he1iskey.fsf@noetbook.telent.net>
Kenny Tilton <·······@nyc.rr.com> writes:

> It's as if Lisp had:
>
>   (defun attraction (make model year)
>     (case make model year
>       ((chevy vette ANY) 'vroom)
>       ((jaguar ANY ANY) 'classy)
>       ((porsche 928 (THRU 1950 1978)) 'classic)
>       ((volkswagen FALSE ANY)))

I'm not sure what that clause there is supposed to do (other than
confuse people who actually look at the parens and not just the
indentation), but I'm pretty sure it's wrong anyway as it doesn't
explicitly mention the design classic that is the Mk1 Golf.

>       ((Ferrari TRUE ANY) 'chick-magnet)))


-dan

-- 

   http://web.metacircles.com/cirCLe_CD - Free Software Lisp/Linux distro
From: Kenny Tilton
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <fNcqb.62484$ri.10424180@twister.nyc.rr.com>
Daniel Barlow wrote:
> Kenny Tilton <·······@nyc.rr.com> writes:
> 
> 
>>It's as if Lisp had:
>>
>>  (defun attraction (make model year)
>>    (case make model year
>>      ((chevy vette ANY) 'vroom)
>>      ((jaguar ANY ANY) 'classy)
>>      ((porsche 928 (THRU 1950 1978)) 'classic)
>>      ((volkswagen FALSE ANY)))
> 
> 
> I'm not sure what that clause there is supposed to do (other than
> confuse people who actually look at the parens and not just the
> indentation), but I'm pretty sure it's wrong anyway as it doesn't
> explicitly mention the design classic that is the Mk1 Golf.

<g> sorry, you guessed right on the syntax, it's kinda like a GOTO in 
that no further clauses are examined. Actually, I should be quiet, my 
recollection is dim after twenty years:

One of you smart guys can probably figure this out:

     http://flashpages.prodigy.net/bettys1/qoc/evaluate.html

:)

kenny

> 
> 
>>      ((Ferrari TRUE ANY) 'chick-magnet)))
> 
> 
> 
> -dan
> 

-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Your Project Here! http://alu.cliki.net/Industry%20Application
From: Edi Weitz
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <87r80mtyl1.fsf@bird.agharta.de>
On Wed, 05 Nov 2003 18:58:00 GMT, Kenny Tilton <·······@nyc.rr.com> wrote:

>       ((porsche 928 (THRU 1950 1978)) 'classic)

Er, you mean 911 instead of 928 and 1963 instead of 1950? (The 928 is
relatively new and not really, cough-cough, a classic. Earlier models,
like the one James Dean used for hist last ride, had numbers like
356.)

Edi.
From: Thomas F. Burdick
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <xcvekwm0zzu.fsf@famine.OCF.Berkeley.EDU>
Kenny Tilton <·······@nyc.rr.com> writes:

> Thomas F. Burdick wrote:
> 
> > Okay, I'll bite; what's up with EVALUATE? 
> 
> It's as if Lisp had:
> 
>   (defun attraction (make model year)
>     (case make model year
>       ((chevy vette ANY) 'vroom)
>       ((jaguar ANY ANY) 'classy)
>       ((porsche 928 (THRU 1950 1978)) 'classic)
>       ((volkswagen FALSE ANY)))
>       ((Ferrari TRUE ANY) 'chick-magnet)))

Okay, cool!  I misread it at first, and thought it was just functional
language style pattern-matching.  Still, it looks like they can be
used for very similar purposes:

  (require :fare-matcher)

  (defun attraction (&rest car &keys make model year)
    (match car
      ((plist :make cadillac :model _ :year _) 'pimpin)
      ((plist :make alfa-romeo) '|velocita`|)
      ((plist :year 2004) 'shiny-new-thing)))

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Thomas A. Russ
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <ymir80lwf08.fsf@sevak.isi.edu>
Kenny Tilton <·······@nyc.rr.com> writes:

> It's as if Lisp had:
> 
>   (defun attraction (make model year)
>     (case make model year
>       ((chevy vette ANY) 'vroom)
>       ((jaguar ANY ANY) 'classy)
>       ((porsche 928 (THRU 1950 1978)) 'classic)
>       ((volkswagen FALSE ANY)))
>       ((Ferrari TRUE ANY) 'chick-magnet)))

Of course, now someone will feel compelled to write a Lisp macro that
does all this....

Who was the recent poster who wanted to learn about writing macros?

-- 
Thomas A. Russ,  USC/Information Sciences Institute
From: Kenny Tilton
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <S_wqb.44134$Gq.10569044@twister.nyc.rr.com>
Thomas A. Russ wrote:
> Kenny Tilton <·······@nyc.rr.com> writes:
> 
> 
>>It's as if Lisp had:
>>
>>  (defun attraction (make model year)
>>    (case make model year
>>      ((chevy vette ANY) 'vroom)
>>      ((jaguar ANY ANY) 'classy)
>>      ((porsche 928 (THRU 1950 1978)) 'classic)
>>      ((volkswagen FALSE ANY)))
>>      ((Ferrari TRUE ANY) 'chick-magnet)))
> 
> 
> Of course, now someone will feel compelled to write a Lisp macro that
> does all this....
> 

I was tempted, but then I remembered I have a negative amount of time on 
my hands. But if with Paul Graham you feel COND has too many 
parentheses, can you imagine how CL-EVALUATE would turn out?!

kenny


-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Your Project Here! http://alu.cliki.net/Industry%20Application
From: Marco Antoniotti
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <GMOqb.142$KR3.49514@typhoon.nyu.edu>
Kenny Tilton wrote:
> 
> 
> Thomas A. Russ wrote:
> 
>> Kenny Tilton <·······@nyc.rr.com> writes:
>>
>>
>>> It's as if Lisp had:
>>>
>>>  (defun attraction (make model year)
>>>    (case make model year
>>>      ((chevy vette ANY) 'vroom)
>>>      ((jaguar ANY ANY) 'classy)
>>>      ((porsche 928 (THRU 1950 1978)) 'classic)
>>>      ((volkswagen FALSE ANY)))
>>>      ((Ferrari TRUE ANY) 'chick-magnet)))
>>
>>
>>
>> Of course, now someone will feel compelled to write a Lisp macro that
>> does all this....
>>
> 
> I was tempted, but then I remembered I have a negative amount of time on 
> my hands. But if with Paul Graham you feel COND has too many 
> parentheses, can you imagine how CL-EVALUATE would turn out?!

This is similar to a ML matching clause.  There is code floating arount 
doing just that already :)

Cheers
--
Marco
From: Sashank Varma
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <none-7131D9.14091706112003@news.vanderbilt.edu>
In article <·······················@twister.nyc.rr.com>,
 Kenny Tilton <·······@nyc.rr.com> wrote:

>   (defun attraction (make model year)
>     (case make model year
>       ((chevy vette ANY) 'vroom)
>       ((jaguar ANY ANY) 'classy)
>       ((porsche 928 (THRU 1950 1978)) 'classic)
>       ((volkswagen FALSE ANY)))
>       ((Ferrari TRUE ANY) 'chick-magnet)))

I once read a review of a ferrari or lamborghini or some
other super sports car.  The author opined that it wasn't
really a chick magnet.  Rather, it attracted drooling men
of all ages.
From: Zach Beane
Subject: OT: Chick magnet cars (was: Re: The Last Lonely Lisp Link)
Date: 
Message-ID: <m3y8utnsaf.fsf_-_@unnamed.xach.com>
Sashank Varma <····@vanderbilt.edu> writes:
> I once read a review of a ferrari or lamborghini or some
> other super sports car.  The author opined that it wasn't
> really a chick magnet.  Rather, it attracted drooling men
> of all ages.

From http://philip.greenspun.com/materialism/cars/nsx:

   "If you don't get laid every day that you're in Los Angeles with
   that car, I'll never have any respect for you," a physicist friend
   of mine said. I can't say that I made a serious effort to win his
   respect, but I did notice in 10 days that men were far more
   interested in the car than women. This would be the ideal car for a
   single /woman/.

Zach
From: Ray Dillinger
Subject: Re: OT: Chick magnet cars (was: Re: The Last Lonely Lisp Link)
Date: 
Message-ID: <3FAAE088.80A5CA0D@sonic.net>
Zach Beane wrote:
> 
> Sashank Varma <····@vanderbilt.edu> writes:
> > I once read a review of a ferrari or lamborghini or some
> > other super sports car.  The author opined that it wasn't
> > really a chick magnet.  Rather, it attracted drooling men
> > of all ages.
> 
> From http://philip.greenspun.com/materialism/cars/nsx:
> 
>    "If you don't get laid every day that you're in Los Angeles with
>    that car, I'll never have any respect for you," a physicist friend
>    of mine said. I can't say that I made a serious effort to win his
>    respect, but I did notice in 10 days that men were far more
>    interested in the car than women. This would be the ideal car for a
>    single /woman/.

Well, it is if you assume that everybody's heterosexual.  But we know 
that's not true.... 

				Bear
From: David Golden
Subject: Re: OT: Chick magnet cars (was: Re: The Last Lonely Lisp Link)
Date: 
Message-ID: <GfBqb.4736$bD.17589@news.indigo.ie>
>> I once read a review of a ferrari or lamborghini or some
>> other super sports car.  The author opined that it wasn't
>> really a chick magnet.  Rather, it attracted drooling men
>> of all ages.
> 

But that is, of course, how it works. Sorry if you regard this as some big
secret and I'm giving the game away, but hey, almost everyone understands
this instinctively:  Men might be more interested in the car directly, but
that's not necessarily how cars and other transient material things are
used to impress [the sufficiently shallow].  If the men are acting
enviously interested in the car, that is enough to make some people
interested -they are after the perceived enhanced social status, not the
car.

In general, people are are lot less rational than they think, including
people who know that.
From: Will Hartung
Subject: Re: OT: Chick magnet cars (was: Re: The Last Lonely Lisp Link)
Date: 
Message-ID: <boerci$1cu94d$1@ID-197644.news.uni-berlin.de>
> But that is, of course, how it works. Sorry if you regard this as some big
> secret and I'm giving the game away, but hey, almost everyone understands
> this instinctively:  Men might be more interested in the car directly, but
> that's not necessarily how cars and other transient material things are
> used to impress [the sufficiently shallow].  If the men are acting
> enviously interested in the car, that is enough to make some people
> interested -they are after the perceived enhanced social status, not the
> car.

The problem is, of course, that the hoards of men ogling the car because its
a chick magnet are blocking and scaring away all the chicks. You just can't
win.

Get a puppy.

Regards,

Will Hartung
(·····@msoft.com)
From: Sashank Varma
Subject: Re: OT: Chick magnet cars (was: Re: The Last Lonely Lisp Link)
Date: 
Message-ID: <none-16510E.18242706112003@news.vanderbilt.edu>
In article <···················@news.indigo.ie>,
 David Golden <············@oceanfree.net> wrote:

> >> I once read a review of a ferrari or lamborghini or some
> >> other super sports car.  The author opined that it wasn't
> >> really a chick magnet.  Rather, it attracted drooling men
> >> of all ages.
> > 
> 
> But that is, of course, how it works. Sorry if you regard this as some big
> secret and I'm giving the game away, but hey, almost everyone understands
> this instinctively:  Men might be more interested in the car directly, but
> that's not necessarily how cars and other transient material things are
> used to impress [the sufficiently shallow].  If the men are acting
> enviously interested in the car, that is enough to make some people
> interested -they are after the perceived enhanced social status, not the
> car.

Sorry, I should have given more details.

Clearly, the tall, large-breasted, Harvard-educated, insanely rich,
church-approved women wanted him.  This was made obvious by the
kisses they blew and the panties they threw.  The writer's point
was that, try as they might, they could not penetrate the throng
of pasty-faced, skateboard-wielding teenagers and aging, balding, 
Car-and-Driver-subscribing men that surrounded the vehicle.

This is the irony of the sports car.

> In general, people are are lot less rational than they think, including
> people who know that.

Yes, I see.
From: lin8080
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <3FAE88B7.8C83C148@freenet.de>
Kenny Tilton schrieb:

> 
>   (defun attraction (make model year)
>     (case make model year
>       ((chevy vette ANY) 'vroom)
>       ((jaguar ANY ANY) 'classy)
>       ((porsche 928 (THRU 1950 1978)) 'classic)
>       ((volkswagen FALSE ANY)))
>       ((Ferrari TRUE ANY) 'chick-magnet)))

hey
I read that and begin to laugh. My girl-friend comes to see why,
chick-magnet she said and looks at me...
I know, computers never get that, hm? 

stefan
From: Kenny Tilton
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <%oyrb.58660$Gq.12077702@twister.nyc.rr.com>
lin8080 wrote:

> 
> Kenny Tilton schrieb:
> 
> 
>>  (defun attraction (make model year)
>>    (case make model year
>>      ((chevy vette ANY) 'vroom)
>>      ((jaguar ANY ANY) 'classy)
>>      ((porsche 928 (THRU 1950 1978)) 'classic)
>>      ((volkswagen FALSE ANY)))
>>      ((Ferrari TRUE ANY) 'chick-magnet)))
> 
> 
> hey
> I read that and begin to laugh. My girl-friend comes to see why,
> chick-magnet she said and looks at me... 

She might be a Maserati babe.

:)

kenny

-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film

Your Project Here! http://alu.cliki.net/Industry%20Application
From: lin8080
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <3FB2C901.549DEFDE@freenet.de>
Kenny Tilton schrieb:


> She might be a Maserati babe.
> 
> :)

((Testarosa TRUE secret) 'gracy maker))
From: Chris Riesbeck
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <b7acf703.0311051050.4b6ab3fe@posting.google.com>
Kenny Tilton <·······@nyc.rr.com> wrote in message news:<······················@twister.nyc.rr.com>...
> JP Massar wrote:
> > The Auckland University of Technology, dateline November 4, 2003.
> > 
> > No worthwile companions do it honor.  No Norvig, no Graham, no Keene.
> > Its next-door neighbor a book on COBOL.   Ignominy.
> 
> Nonsense. COBOL has loose typing and is the only language on Earth with 
> a multiple-dispatch "cond", viz. EVALUATE. COND is why Lisp got created, 
> so a little respect is due the langugae that took COND the furthest. I 
> dare say COBOL is also the only language with MOVE-CORRESPONDING. Native 
> ISAM, which come to think of it would not be a bad idea at all for a CL 
> substandard. I am proud to have COBOL as my next-door alphabetic neighbor.

My favorite COBOL logical syntax was the ability to say IF X > 1 AND < 10 ...

Did any other language support that?
From: Lars Brinkhoff
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <85llquhbdu.fsf@junk.nocrew.org>
········@cs.northwestern.edu (Chris Riesbeck) writes:
> My favorite COBOL logical syntax was the ability to say IF X > 1 AND < 10 ...
> Did any other language support that?

Lisp comes close:

        (if (< 1 x 10) ...)

-- 
Lars Brinkhoff,         Services for Unix, Linux, GCC, HTTP
Brinkhoff Consulting    http://www.brinkhoff.se/
From: Marcin 'Qrczak' Kowalczyk
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <pan.2003.11.05.19.49.06.840162@knm.org.pl>
On Wed, 05 Nov 2003 10:50:40 -0800, Chris Riesbeck wrote:

> My favorite COBOL logical syntax was the ability to say IF X > 1 AND < 10 ...
> 
> Did any other language support that?

In Python and Icon you can write
   1 < X < 10

-- 
   __("<         Marcin Kowalczyk
   \__/       ······@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/
From: Madhu
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <xfesmkysuiw.fsf@shelby.cs.unm.edu>
Helu
* (Chris Riesbeck) <····························@posting.google.com> :
|
| My favorite COBOL logical syntax was the ability to say IF X > 1 AND < 10 ...
|
| Did any other language support that?

SCNR


Of course this doesn't make a lot of sense in lisp; and I couldnt find
this syntax specified anywhere, So I was wondering if the following
comes close to what you wanted:


;; clauses --> clause [logical-op clause]*
;; clause --> lhs op rhs | op arg.

;; now op arg --> (op LH$ arg) where LH$ is an lhs from an earlier
;; clause, 
;;      or it is: (op arg)     where op is treated as a predicate.

(defvar *lhs*) ; unbound

(defun clausify (args)
  (cond ((null args) nil)
	((atom args) args)
	(t (let* ((rest (or (member 'and args)
			    (member 'or args)
			    (member 'not args)))
		  (clause (ldiff args rest))
		  (items (ecase (length clause)	;  (&optional op lhs rhs)
			   (0)
			   (1 (let ((x (clausify (car clause))))
				(if (atom x) (list x) x)))
			   (3 (list (cadr clause) (car clause)
				    (caddr clause)))
			   (2 (let ((op (car clause)))
				(if (boundp '*lhs*)
				    (list op *lhs* (cadr clause))
				    (list op (cadr clause)))))))
		  (lhs (second items)))
	     (if rest
		 (let ((tail (list
			      (if lhs
				  (let ((*lhs* lhs)) (clausify (cdr rest)))
				  (clausify (cdr rest))))))
		   (rplacd rest (if items (cons items tail) tail)))
		 items)))))


;; I think that is now worthy of this name
(defmacro if* ((&rest args) &body body)
  `(if ,(clausify args) ,@body))

;;
* (pprint (macroexpand-1 '(IF* (X > 1 AND < 10) 'foo 'bar)))
(IF (AND (> X 1) (< X 10)) 'FOO 'BAR)



--
Regards
Madhu (hadnt written caddr in a while)
From: Chris Riesbeck
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <b7acf703.0311101105.b41f580@posting.google.com>
Madhu <·····@cs.unm.edu> wrote in message news:<···············@shelby.cs.unm.edu>...
> Helu
> * (Chris Riesbeck) <····························@posting.google.com> :
> |
> | My favorite COBOL logical syntax was the ability to say IF X > 1 AND < 10 ...
> |
> 
> Of course this doesn't make a lot of sense in lisp; and I couldnt find
> this syntax specified anywhere,

It's described at http://docs.hp.com/cgi-bin/doc3k/BB243390008.13027/29
-- search for the section "Abbreviated Combined Relation Conditions."

> So I was wondering if the following
> comes close to what you wanted:
> 
> ;; clauses --> clause [logical-op clause]*
> ;; clause --> lhs op rhs | op arg.
> 
> ;; now op arg --> (op LH$ arg) where LH$ is an lhs from an earlier
> ;; clause, 
> ;;      or it is: (op arg)     where op is treated as a predicate.

Kind of -- you can even leave both subject and relational operator,
e.g., from the web site:

  a > b AND NOT < c OR d

which expands to

 ((a > b) AND (a NOT < c)) OR (a NOT < d)

> * (pprint (macroexpand-1 '(IF* (X > 1 AND < 10) 'foo 'bar)))
> (IF (AND (> X 1) (< X 10)) 'FOO 'BAR)

Assuming we'd want to keep Lisp's prefix notation, I'd do the Cobol
example in Lisp as

(if* (and (> a b) (not (< c)) d) ...)

though perhaps this is LOOP-y enough that you're right and it should
be mixed syntax:

(if* (> a b) and not (< c) or d ...)

This seems like one of those macros that if you code it, we'll have to
kill you, just to keep it from getting out. :O)

(And remember that I'm one of those guys who likes LOOP...)
From: Vijay L
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <1eaf81aa.0311130743.66ff5466@posting.google.com>
Madhu <·····@cs.unm.edu> wrote in message news:<···············@shelby.cs.unm.edu>...
> Helu
> * (Chris Riesbeck) <····························@posting.google.com> :
> |
> | My favorite COBOL logical syntax was the ability to say IF X > 1 AND < 10 ...
> |
> | Did any other language support that?
> 
> SCNR
> 
> 
> Of course this doesn't make a lot of sense in lisp; and I couldnt find
> this syntax specified anywhere, So I was wondering if the following
> comes close to what you wanted:
> 
> 
> ;; clauses --> clause [logical-op clause]*
> ;; clause --> lhs op rhs | op arg.
> 
> ;; now op arg --> (op LH$ arg) where LH$ is an lhs from an earlier
> ;; clause, 
> ;;      or it is: (op arg)     where op is treated as a predicate.
> 
> (defvar *lhs*) ; unbound
> 
> (defun clausify (args)
>   (cond ((null args) nil)
> 	((atom args) args)
> 	(t (let* ((rest (or (member 'and args)
> 			    (member 'or args)
> 			    (member 'not args)))

Shouldn't it be 
(rest (or (member 'not args)
          (member 'and args)
          (member 'or  args))) 

in the usual priority of NOT > AND > OR ?
  
Cheers,
Vijay

I have a Common Lisp; and I'm pwoud of it.
From: Madhu
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <xfeoevfs0jh.fsf@shelby.cs.unm.edu>
Helu
*  (Vijay L) <····························@posting.google.com> :

| Madhu  wrote in message news:<···············@shelby.cs.unm.edu>...
<snip> 
|> (defun clausify (args)
This was largely a joke of course. best left untouched;

|>   (cond ((null args) nil)
|> 	((atom args) args)
|> 	(t (let* ((rest (or (member 'and args)
|> 			    (member 'or args)
|> 			    (member 'not args)))
|
| Shouldn't it be 
| (rest (or (member 'not args)
|           (member 'and args)
|           (member 'or  args))) 
|
| in the usual priority of NOT > AND > OR ?


Yep that would fix precedence but it would still be buggy . This is
prolly closer to what was specified:
...
(rest (car (stable-sort
             (list (member 'not args)
                   (member 'and args)
                   (member 'or args)) 
             #'> :key #'length)))

|
| I have a Common Lisp; and I'm pwoud of it.
                  ^^             ^
heh heh (took me a while to get it)

--
Regards
Madhu
From: Sebastian Stern
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <ad7d32de.0311140701.94a645d@posting.google.com>
Madhu wrote:
> *  (Vijay L) <····························@posting.google.com> :
> | I have a Common Lisp; and I'm pwoud of it.
>                   ^^             ^
> heh heh (took me a while to get it)

Actually, that is called a substitution error (wing for ring), whereas
a lisp is a distortion error (thip for sip).  For more information,
see Guy L. Steele's paper "WABBIT: a compiler for Thcheme."

Sebastian Stern
"Freedom is the freedom to say (= (+ 2 2) 4). If that is granted, all
else follows."
From: Vijay L
Subject: Re: The Last Lonely Lisp Link
Date: 
Message-ID: <1eaf81aa.0311141125.ca4e97e@posting.google.com>
········@yahoo.com (Sebastian Stern) wrote in message news:<···························@posting.google.com>...
> Madhu wrote:
> > *  (Vijay L) <····························@posting.google.com> :
> > | I have a Common Lisp; and I'm pwoud of it.
> >                   ^^             ^
> > heh heh (took me a while to get it)
> 
> Actually, that is called a substitution error (wing for ring), whereas
> a lisp is a distortion error (thip for sip).  For more information,
> see Guy L. Steele's paper "WABBIT: a compiler for Thcheme."

Too true.  Initially I thought of "I have a Lithp and I'm proud of it"
but, as Madhu has pointed out, that wouldn't have elicited his "heh
heh (took me a while to get it)".  Thatta way the innacurathy helpth
:)

Cheers,
Vijay

I have a Common Lisp; and I'm pwoud of it.