From: Nelson Marcelino
Subject: Lisp
Date: 
Message-ID: <d4626d19.0405280941.4d00a9bb@posting.google.com>
I would like to know if Lisp provides List Comprehensions (Zermelo
Frankel).
Also I am interested in logic programming. Besides LispWorks which
provides
an embedded prolog is there either a production rule system (I checked
out
LISA but have not yet installed) or prolog module available for lisp?
I did look at Schelog for scheme but would like to know if such is
available for lisp.

I have downloaded on my Mac OSX SBCL, Clisp, and OpenMCL does anyone
have any preference to any of these, or other recommendations?

I have PAIP, both of grahams books, winston's book, the steele
reference, etc.
I am interested in doing Mathematical programming, and expert systems
development. I was considering either a functional language to do it
in, Lisp,
or a logic based Languages such as Prolog, XSB, mercury etc. Any
advice on this matter?

I have just setup Emacs+SBCL+slime. How do i get automatic indentation
when I am creating a source File?

Nelson

From: Fred Gilham
Subject: Re: Lisp
Date: 
Message-ID: <u7n03s9yrt.fsf@snapdragon.csl.sri.com>
> I am interested in doing Mathematical programming, and expert
> systems development. I was considering either a functional language
> to do it in, Lisp, or a logic based Languages such as Prolog, XSB,
> mercury etc. Any advice on this matter?

For logic programming, you can take a look at Screamer by Jeffrey Mark
Siskind.  It's a nondeterministic extension to lisp and it also has
constraints.  It's very well integrated.

If you've got PAIP, you'll also find a Prolog system including a
compiler.  We've used that for DCG parsing.  It's not the fastest kid
on the block, but it does seem to be usable.

If you don't care about logic programming as such, Lisp is fine for
mathematical programming (see the Maxima system) and there are a
number of expert system environments in Lisp.  There is a new system
called Lisa, developed by David Young, that seems to be quite good.

-- 
Fred Gilham                                         ······@csl.sri.com
When my years have come and gone, I hope I'll have the wisdom to fly
like a bird of fire into the twilight sky of life. -- Vincent Sargenti
From: Kenny Tilton
Subject: Re: Lisp
Date: 
Message-ID: <ZoMtc.64819$mX.21234319@twister.nyc.rr.com>
Fred Gilham wrote:

>>I am interested in doing Mathematical programming, and expert
>>systems development. I was considering either a functional language
>>to do it in, Lisp, or a logic based Languages such as Prolog, XSB,
>>mercury etc. Any advice on this matter?
> 
> 
> For logic programming, you can take a look at Screamer by Jeffrey Mark
> Siskind.  It's a nondeterministic extension to lisp and it also has
> constraints.  It's very well integrated.

Yes, I meant to mention Screamer/Screamer+. Chris Double wrote about his 
Corman port last year:

    http://radio.weblogs.com/0102385/2003/03/12.html

Links at the bottom of that lead to more info on Screamer/Screamer+.

kenny

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Kenny Tilton
Subject: Re: Lisp
Date: 
Message-ID: <Z4Ltc.64813$mX.21223793@twister.nyc.rr.com>
Nelson Marcelino wrote:
> I would like to know if Lisp provides List Comprehensions (Zermelo
> Frankel).
> Also I am interested in logic programming. Besides LispWorks which
> provides
> an embedded prolog is there either a production rule system (I checked
> out
> LISA but have not yet installed) or prolog module available for lisp?
> I did look at Schelog for scheme but would like to know if such is
> available for lisp.
> 
> I have downloaded on my Mac OSX SBCL, Clisp, and OpenMCL does anyone
> have any preference to any of these, or other recommendations?
> 
> I have PAIP, both of grahams books, winston's book, the steele
> reference, etc.
> I am interested in doing Mathematical programming, and expert systems
> development. I was considering either a functional language to do it
> in, Lisp,
> or a logic based Languages such as Prolog, XSB, mercury etc. Any
> advice on this matter?

Prolog will drive you nuts when it is not the paradigm you need (which 
will be most of the time). Try to find an embedded Prolog or something.

My 2 from the cheap seats.

kenny

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Edi Weitz
Subject: Re: Lisp
Date: 
Message-ID: <873c5k30as.fsf@bird.agharta.de>
On 28 May 2004 10:41:46 -0700, ·········@yahoo.com (Nelson Marcelino) wrote:

> I would like to know if Lisp provides List Comprehensions (Zermelo
> Frankel).

<http://www.cs.uni-bonn.de/~costanza/lisp-ecoop/submissions/Nystrom.pdf>
From: Svein Ove Aas
Subject: Re: Lisp
Date: 
Message-ID: <P9Ltc.4565$RL3.87958@news2.e.nsc.no>
Nelson Marcelino wrote:

> I would like to know if Lisp provides List Comprehensions (Zermelo
> Frankel).

I googled on Z.F. and got set theory, which I'm not going to try mapping
into Lisp right now.

Your answer is almost certainly yes, though; there are a number of ways to
do it, the simplest likely being (mapcar). It runs a function on every
member of a list in turn and returns the results as a new list; if that
isn't what you want, there are a number of other functions in the family.

> Also I am interested in logic programming. Besides LispWorks which
> provides
> an embedded prolog is there either a production rule system (I checked
> out
> LISA but have not yet installed) or prolog module available for lisp?
> I did look at Schelog for scheme but would like to know if such is
> available for lisp.

No doubt; it's simple to implement Prolog - or any similar system - in
Lisp. IIRC there's an example in "On Lisp", if you want.

You could take a look at the library page on www.cliki.net to see if you
can find anything fitting.

> I have downloaded on my Mac OSX SBCL, Clisp, and OpenMCL does anyone
> have any preference to any of these, or other recommendations?

I use SBCL for three reasons:
- It comes with ASDF and ASDF-INSTALL built-in; this saves a little work.
- Everything's compiled, period; I don't have to worry about forgetting.
- It seems to be under active development, or more active at least.

That said, I don't have a Mac.
 
> I have PAIP, both of grahams books, winston's book, the steele
> reference, etc.

If you use Emacs+SLIME then you should have CLHS a keypress away. Do you?

> I am interested in doing Mathematical programming, and expert systems
> development. I was considering either a functional language to do it
> in, Lisp,
> or a logic based Languages such as Prolog, XSB, mercury etc. Any
> advice on this matter?

That depends. If you're sure it fits Prolog best, then use Prolog; the
same goes for the others. If there's any chance you might go outside the
boundaries of that language, use Lisp instead; it can do logic
programming as easily as any other with a modicum of investment, and
there's no chance of running into walls.

> I have just setup Emacs+SBCL+slime. How do i get automatic indentation
> when I am creating a source File?

(global-set-key "\r" 'newline-and-indent)

Putting the above in .emacs does it for me, but it's a bit slash&burn-ish.
That's only an issue if you have some indent-capable mode that you
*don't* want autoindent in, though.
From: Andreas Scholta
Subject: Re: Lisp
Date: 
Message-ID: <87pt8mc9mv.fsf@solace.kozmoz.org>
Svein Ove Aas <··············@brage.info> writes:

> (global-set-key "\r" 'newline-and-indent)
> 
> Putting the above in .emacs does it for me, but it's a bit slash&burn-ish.
> That's only an issue if you have some indent-capable mode that you
> *don't* want autoindent in, though.
> 

How about (slime-define-key "\r" 'newline-and-indent)?
That's what I have in my slime-mode-hook (for no apparent reason).

-- 
cheers,
    Andreas Scholta
From: Svein Ove Aas
Subject: Re: Lisp
Date: 
Message-ID: <c9ctum$j7v$1@news.dataguard.no>
Andreas Scholta wrote:

> Svein Ove Aas <··············@brage.info> writes:
> 
>> (global-set-key "\r" 'newline-and-indent)
>> 
>> Putting the above in .emacs does it for me, but it's a bit
>> slash&burn-ish. That's only an issue if you have some indent-capable
>> mode that you *don't* want autoindent in, though.
>> 
> 
> How about (slime-define-key "\r" 'newline-and-indent)?
> That's what I have in my slime-mode-hook (for no apparent reason).
> 
Because I don't really know how Emacs works.
Besides that, that behaviour is something I prefer to be global, so the
global-set suits me just fine; YMMV.
From: Andreas Scholta
Subject: Re: Lisp
Date: 
Message-ID: <87y8n9lvjd.fsf@solace.kozmoz.org>
Just wanted to give an alternative in the case of him not wanting it to
be global behaviour. No attack intended.

Oh, I don't have any idea about emacs either, I just took a quick look
at slime.el.

-- 
cheers,
    Andreas Scholta
From: Gareth McCaughan
Subject: Re: Lisp
Date: 
Message-ID: <873c5knnul.fsf@g.mccaughan.ntlworld.com>
·········@yahoo.com (Nelson Marcelino) writes:

> I would like to know if Lisp provides List Comprehensions (Zermelo
> Frankel).

They are not part of the language itself, but because Lisp is
extensible they can be added seamlessly. Sven-Olof Nystrom has
what looks like a nice implementation. The syntax is more wordy
and less punctuation-heavy than that of (say) Miranda or Python,
and it's also more flexible.

> I have downloaded on my Mac OSX SBCL, Clisp, and OpenMCL does anyone
> have any preference to any of these, or other recommendations?

They're all good, in different ways. Keep them all; if
nothing else, it will encourage you to write portable
code.

> I have PAIP, both of grahams books, winston's book, the steele
> reference, etc.
> I am interested in doing Mathematical programming, and expert systems
> development. I was considering either a functional language to do it
> in, Lisp,
> or a logic based Languages such as Prolog, XSB, mercury etc. Any
> advice on this matter?

Languages like Prolog are great when what you're doing is
just what they're designed for. But when you step outside
that domain, they get nasty much faster than a more general-
-purpose language like Lisp does. I haven't used Mercury
and haven't even *heard* of XSB, so can't comment specifically
on those.

Some of the functional languages are very usable for general-
-purpose programming. Choosing between them and Lisp is mostly
a matter of taste. 

-- 
Gareth McCaughan
.sig under construc
From: Marco Antoniotti
Subject: Re: Lisp
Date: 
Message-ID: <PWGvc.3$2i5.1739@typhoon.nyu.edu>
Nelson Marcelino wrote:
> I would like to know if Lisp provides List Comprehensions (Zermelo
> Frankel).

You can check my SETL in Lisp system (google for it on the newsgroup). 
You can write

(defun collecting (xs)
   {(+ x 1) / x in xs / (> x 27)})


and

(defun primes (max)
   [n in (range 3 max 2) / (not (exist m in (range 3
                                                   (min (1- n)
                                                        (+ 2 (sqrt n))) 

                                                   2)
                         / (= (mod n m) 0)))])



You can improve on that.



> Also I am interested in logic programming. Besides LispWorks which
> provides
> an embedded prolog is there either a production rule system (I checked
> out
> LISA but have not yet installed) or prolog module available for lisp?
> I did look at Schelog for scheme but would like to know if such is
> available for lisp.

Writing a Prolog interpreter in Common Lisp is a good exercise.  You can 
easily translate (and improve) the example form SICP or implement the 
example from Norvig.  Implementing a WAM, as LW does, is another thing 
altogether.


> 
> I have downloaded on my Mac OSX SBCL, Clisp, and OpenMCL does anyone
> have any preference to any of these, or other recommendations?
> 
> I have PAIP, both of grahams books, winston's book, the steele
> reference, etc.
> I am interested in doing Mathematical programming, and expert systems
> development. I was considering either a functional language to do it
> in, Lisp,
> or a logic based Languages such as Prolog, XSB, mercury etc. Any
> advice on this matter?
> 
> I have just setup Emacs+SBCL+slime. How do i get automatic indentation
> when I am creating a source File?

Emacs does a minimum of indentation setting the buffer in "Lisp Mode". 
SLIME and ILISP *DO NOT DO INDENTATION*.  You may have to look at the 
`lisp-indent-function' of Emacs for clues about how to change it.

Cheers
--
marco
From: Luke Gorrie
Subject: Re: Lisp
Date: 
Message-ID: <lhaczkad12.fsf@dodo.bluetail.com>
Marco Antoniotti <·······@cs.nyu.edu> writes:

> Emacs does a minimum of indentation setting the buffer in "Lisp
> Mode". SLIME and ILISP *DO NOT DO INDENTATION*.  You may have to look
> at the `lisp-indent-function' of Emacs for clues about how to change
> it.

Actually SLIME does: it scans the Lisp image for macros with '&body'
parameters and configures `common-lisp-indent-function' properties
appropriately.

It should "just work", but there are caveats described in the manual.

Cheers,
Luke
From: Marco Antoniotti
Subject: Re: Lisp
Date: 
Message-ID: <chKvc.4$2i5.1769@typhoon.nyu.edu>
Luke Gorrie wrote:
> Marco Antoniotti <·······@cs.nyu.edu> writes:
> 
> 
>>Emacs does a minimum of indentation setting the buffer in "Lisp
>>Mode". SLIME and ILISP *DO NOT DO INDENTATION*.  You may have to look
>>at the `lisp-indent-function' of Emacs for clues about how to change
>>it.
> 
> 
> Actually SLIME does: it scans the Lisp image for macros with '&body'
> parameters and configures `common-lisp-indent-function' properties
> appropriately.
> 
> It should "just work", but there are caveats described in the manual.

That is good, but it should be separated out. 
'common-lisp-indent-function' has nothing to do with the functionalities 
provided by SLIME and/or ILISP.

Cheers
--
Marco
From: Thomas F. Burdick
Subject: Re: Lisp
Date: 
Message-ID: <xcv4qpsfdiq.fsf@famine.OCF.Berkeley.EDU>
Marco Antoniotti <·······@cs.nyu.edu> writes:

> Luke Gorrie wrote:
> > Marco Antoniotti <·······@cs.nyu.edu> writes:
> > 
> > 
> >>Emacs does a minimum of indentation setting the buffer in "Lisp
> >>Mode". SLIME and ILISP *DO NOT DO INDENTATION*.  You may have to look
> >>at the `lisp-indent-function' of Emacs for clues about how to change
> >>it.
> > 
> > 
> > Actually SLIME does: it scans the Lisp image for macros with '&body'
> > parameters and configures `common-lisp-indent-function' properties
> > appropriately.
> > 
> > It should "just work", but there are caveats described in the manual.
> 
> That is good, but it should be separated out. 
> 'common-lisp-indent-function' has nothing to do with the functionalities 
> provided by SLIME and/or ILISP.

Well, it depends pretty heavily on having SLIME there: it uses
introspection in the running Lisp to determine how to indent source
forms.

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Tim Bradshaw
Subject: Re: Lisp
Date: 
Message-ID: <fbc0f5d1.0406040422.1eb5c4e8@posting.google.com>
·········@yahoo.com (Nelson Marcelino) wrote in message news:<····························@posting.google.com>...
> I would like to know if Lisp provides List Comprehensions (Zermelo
> Frankel).

I don't know how they relate to the ZF stuff, but I have a little
python-style list-comprehension macro at
www.tfeb.org/lisp.toys.html#LIST-COMPREHENSIONS.

Youu can say:

(gather (* x 2)
  for (x '(1 2 3 4))
  when (oddp x))

or, if you'd rather not use the FOR macro (also Python-style), since
FOR is just a slower DOLIST in the case of lists:

(gather (* x 2)
  dolist (x '(1 2 3 4))
  when (oddp x))

you can generalise these things a lot.

--tim