From: Lorena Santana
Subject: Programming Paradigms in Lisp
Date: 
Message-ID: <4b6abdfa.0410191228.328e947b@posting.google.com>
What are the programming paradigms in Lisp? I mean criteria of
evaluation Lisp, such as: writability, readability, portability,
reliability, etc? What are the benefits of using Lisp comparing with
other languages of functional paradigm?

Thanks,
Lorena from Brasil

From: Rahul Jain
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87mzyitmx9.fsf@nyct.net>
········@gmail.com (Lorena Santana) writes:

> What are the programming paradigms in Lisp? I mean criteria of
> evaluation Lisp, such as: writability, readability, portability,
> reliability, etc? What are the benefits of using Lisp comparing with
> other languages of functional paradigm?

The benefits are that Lisp is not constrained to the functional
paradigm. It is a tool you can use to add programming paradigms to
itself. Once you use a programming paradigm that fits the problem
domain, your code becomes more readable, as it contains only the
relevant information. Writing your code in Common Lisp lets you leverage
the various implementations there are for it and the porting work they
have done. It is as reliable as your implementation. If you are thinking
about the ability to recover from code that contains bugs, Lisp is
unparalled. You can redefine code and even classes on the fly, while
your code has "crashed" and then restart execution where the broken code
was invoked.

-- 
Rahul Jain
·····@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist
From: Kenny Tilton
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <C_edd.31258$4C.6436058@twister.nyc.rr.com>
Lorena Santana wrote:
> What are the programming paradigms in Lisp? I mean criteria of
> evaluation Lisp, such as: writability, readability, portability,
> reliability, etc? What are the benefits of using Lisp comparing with
> other languages of functional paradigm?
> 
> Thanks,
> Lorena from Brasil

Why do you ask?

:)

kenny

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: Vladimir Sedach
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <874qkqxwu3.fsf@shawnews.cg.shawcable.net>
I think I'll give a generic answer to the generic and oft-asked
question "What are the benefits of using Lisp comparing with other
languages of _blank_ paradigm?" Feel free to copy and post it anywhere
you like.

Q: What are the benefits of using Lisp comparing with other languages
of functional paradigm?

A: setf, do, loop, mutable data structures, multiple return values,
lexical closures (look ma, my anonymous functions have _state_!), real
streams, conditions/exceptions

Q: What are the benefits of using Lisp comparing with other languages
of structured paradigm?

A: go (*), special variables, anaphoric macros

Q:  What are the benefits of using Lisp comparing with other languages
of object-oriented paradigm?

A: most things aren't objects, multimethods (single-dispatch is for
pussies), (setf (slot-value... anywhere you like to your heart's
content

Q: What are the benefits of using Lisp comparing with other languages
of imperative paradigm?

A: map, reduce, funcall, lambda, apply, eval (~)

Q: What are the benefits of using Lisp comparing with other languages
of logic paradigm?

A: My Prolog is faster than yours.
http://home.comcast.net/~bc19191/blog/040920.html

Q: What are the benefits of using Lisp comparing with other languages
of assembler paradigm?

A: dpb, ldb

Notes:

* - An example of idiomatic Lisp code:
http://lispmeister.com/blog/lisp-news/richard-greenblatt.html

~ - Some people might say I'm leaving out things like let, loop, and
setf, but who uses those for imperative programming?

Vladimir
From: Rahul Jain
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <876556t1ml.fsf@nyct.net>
Vladimir Sedach <(string-downcase (concatenate 'string last-name (subseq first-name 0 1)))@cpsc.ucalgary.ca> writes:

> Q:  What are the benefits of using Lisp comparing with other languages
> of object-oriented paradigm?
>
> A: most things aren't objects,

In Lisp, all data are objects.

> multimethods (single-dispatch is for pussies),

And powerful method combination, which makes MI and MD useful and
usable.

> (setf (slot-value... anywhere you like to your heart's content

I'd say easily-created getters and accessors is more important.

> Q: What are the benefits of using Lisp comparing with other languages
> of assembler paradigm?
>
> A: dpb, ldb

I don't see what that has to do with assembler. Those are bitwise
operations, and lisp has lots more where those came from.

> * - An example of idiomatic Lisp code:
> http://lispmeister.com/blog/lisp-news/richard-greenblatt.html

EEK, Greenblatt! Don't scar the newbies! :)

> ~ - Some people might say I'm leaving out things like let, loop, and
> setf, but who uses those for imperative programming?

Uh... I hope I'm missing some attempt at humor here... But personally, I
like using SERIES for imperative programming. ;)

-- 
Rahul Jain
·····@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist
From: Szymon
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <873c09j3ei.fsf@eva.rplacd.net>
Rahul Jain <·····@nyct.net> writes:

> Vladimir Sedach <(string-downcase (concatenate 'string last-name (subseq first-name 0 1)))@cpsc.ucalgary.ca> writes:
> 
> > Q:  What are the benefits of using Lisp comparing with other languages
> > of object-oriented paradigm?
> >
> > A: most things aren't objects,
> 
> In Lisp, all data are objects.

(defvar *a* (make-instance ...??...))

*a*

==> 99

I have no idea what ...??... should be.

Regards, Szymon.
From: Mark McConnell
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <d3aed052.0410200328.2c6f6399@posting.google.com>
> > In Lisp, all data are objects.
> 
> (defvar *a* (make-instance ...??...))
> 
> *a*
> 
> ==> 99
> 
> I have no idea what ...??... should be.

To make an instance of 99, type 99.  You can then use 99 in
object-oriented methods.

(defmethod divisible-by-11 ((x integer))
  (zerop (mod x 11)))

(defmethod divisible-by-11 ((x (eql 99)))
  "I'm feeling uptight today."
  t)

(defmethod divisible-by-11 ((x t))
  (cerror "What kind of object are you trying to pass me?  Didn't I
tell you I was feeling uptight today?"))
From: Espen Vestre
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <kwfz49sst7.fsf@merced.netfonds.no>
Szymon <············@o2.pl> writes:

> (defvar *a* (make-instance ...??...))
>
> *a*
>
> ==> 99
>
> I have no idea what ...??... should be.
>
> Regards, Szymon.

Is that your definition of 'object'?
-- 
  (espen)
From: Szymon
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87y8i1hjhs.fsf@eva.rplacd.net>
Espen Vestre <·····@*do-not-spam-me*.vestre.net> writes:

> Szymon <············@o2.pl> writes:
> 
> > (defvar *a* (make-instance ...??...))
> >
> > *a*
> >
> > ==> 99
> >
> > I have no idea what ...??... should be.
> >
> > Regards, Szymon.
> 
> Is that your definition of 'object'?

No, btw if built-in-class fixnum exists so it should be possible (??) to
make instance of that class.

(class-of (the fixnum 0))

==> #<BUILT-IN-CLASS FIXNUM {282A74E5}>

(defvar *a* (make-instance * ...??...))

Regards, Szymon.
From: Szymon
Subject: [FIX] Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87u0sphj9b.fsf_-_@eva.rplacd.net>
Szymon <············@o2.pl> writes:

> [.....]
> No, btw if built-in-class fixnum exists so it should be possible (??) to
> make instance of object of that class.
> [.....]

Regards, Szymon.
From: Edi Weitz
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <uk6tlvjju.fsf@agharta.de>
On 20 Oct 2004 10:38:39 +0200, Szymon <············@o2.pl> wrote:

> No, btw if built-in-class fixnum exists so it should be possible
> (??) to make instance of that class.

No problem.

  * 42

  42
  * (class-of *)

  #<BUILT-IN-CLASS FIXNUM {2829BAED}>

Why do you think you need MAKE-INSTANCE to do that?

Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Szymon
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87pt3dhhtd.fsf@eva.rplacd.net>
Edi Weitz <········@agharta.de> writes:

> On 20 Oct 2004 10:38:39 +0200, Szymon <············@o2.pl> wrote:
> 
> > No, btw if built-in-class fixnum exists so it should be possible
> > (??) to make instance of that class.

Sorry. I mean "to make instance of _object_ (*) of that class",
not "make instance of that class".

(*) here: 'fixnum object', for example 99.

(make-instance (class-of (the fixnum 0)) ?????? )

==> 99

Regards, Szymon.
From: Tim Bradshaw
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <1098271149.101659.119330@f14g2000cwb.googlegroups.com>
Szymon wrote:
>
> Sorry. I mean "to make instance of _object_ (*) of that class",
> not "make instance of that class".
>

I think the main issue is not whether MAKE-INSTANCE works, since there
are already other ways of making numbers, but whether DEFMETHOD works.
And of course DEFMETHOD *does* work for numbers (and other built-in
classes).

--tim
From: Pascal Costanza
Subject: OOP, was Re: Programming Paradigms in Lisp
Date: 
Message-ID: <cl5iv2$o7k$1@f1node01.rhrz.uni-bonn.de>
Tim Bradshaw wrote:

> Szymon wrote:
> 
>>Sorry. I mean "to make instance of _object_ (*) of that class",
>>not "make instance of that class".
> 
> I think the main issue is not whether MAKE-INSTANCE works, since there
> are already other ways of making numbers, but whether DEFMETHOD works.
> And of course DEFMETHOD *does* work for numbers (and other built-in
> classes).

Different people have different ideas about what makes a language 
object-oriented. You cannot just pick one that you like the most and 
measure everything else against such an arbitrary choice. (I hope it's 
clear that I am not specifically talking about you, Tim. See also 
http://www.paulgraham.com/reesoo.html )

AFAICS, the only thing that all object-oriented languages have in common 
is the notion of object identity. From there you can go quite a long 
way, including mapping object identities to state (slots) and behavior 
(methods). Different OOP languages just have different ways to construct 
those mappings (and CLOS classes and generic functions are among the 
most powerful).

Without object identity, you are essentially stuck with a pure 
functional approach.

In Common Lisp, numbers of course also have identity, as guaranteed by 
the EQL operator.


Pascal

-- 
Pascal Costanza               University of Bonn
···············@web.de        Institute of Computer Science III
http://www.pascalcostanza.de  R�merstr. 164, D-53117 Bonn (Germany)
From: ·········@random-state.net
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <cl5k20$cos6c$2@midnight.cs.hut.fi>
Szymon <············@o2.pl> wrote:

> Sorry. I mean "to make instance of _object_ (*) of that class",
> not "make instance of that class".

If you must:

* (sb-mop:class-prototype (find-class 'fixnum))

42

Cheers,

 -- Nikodemus                   "Not as clumsy or random as a C++ or Java. 
                             An elegant weapon for a more civilized time."
From: Karl A. Krueger
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <cl60if$k2i$1@baldur.whoi.edu>
·········@random-state.net wrote:
> Szymon <············@o2.pl> wrote:
>> Sorry. I mean "to make instance of _object_ (*) of that class",
>> not "make instance of that class".
> 
> If you must:
> 
> * (sb-mop:class-prototype (find-class 'fixnum))
> 
> 42

The class-prototype of class FUNCTION seems to be strange.

In SBCL:


* (type-of (class-prototype (find-class 'function)))

FUNCTION

* (setf (symbol-function 'pants) (class-prototype (find-class 'function)))

debugger invoked on a TYPE-ERROR in thread 10900:
  The value #<FUNCTION {54B3AF1}> is not of type FUNCTION.


( So it is of type FUNCTION, but it is not of type FUNCTION? )

-- 
Karl A. Krueger <········@example.edu> { s/example/whoi/ }

Every program has at least one bug and can be shortened by at least one line.
By induction, every program can be reduced to one line which does not work.
From: Rahul Jain
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87u0solp9a.fsf@nyct.net>
"Karl A. Krueger" <········@example.edu> writes:

> The class-prototype of class FUNCTION seems to be strange.

I think #'IDENTITY is a reasonable value for that. Just my 2 cents.

-- 
Rahul Jain
·····@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist
From: Szymon
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87lle1hgx2.fsf@eva.rplacd.net>
Edi Weitz <········@agharta.de> writes:

> On 20 Oct 2004 10:38:39 +0200, Szymon <············@o2.pl> wrote:
> 
> > No, btw if built-in-class fixnum exists so it should be possible
> > (??) to make instance of that class.
> 
> No problem.
> 
>   * 42
> 
>   42
>   * (class-of *)
> 
>   #<BUILT-IN-CLASS FIXNUM {2829BAED}>
> 
> Why do you think you need MAKE-INSTANCE to do that?

I'm curious person.

Regards, Szymon.
From: Szymon
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87hdophgto.fsf@eva.rplacd.net>
Szymon <············@o2.pl> writes:

> Edi Weitz <········@agharta.de> writes:
> 
> > On 20 Oct 2004 10:38:39 +0200, Szymon <············@o2.pl> wrote:
> > 
> > > No, btw if built-in-class fixnum exists so it should be possible
> > > (??) to make instance of that class.
> > 
> > No problem.
> > 
> >   * 42
> > 
> >   42
> >   * (class-of *)
> > 
> >   #<BUILT-IN-CLASS FIXNUM {2829BAED}>
> > 
> > Why do you think you need MAKE-INSTANCE to do that?
> 
> I'm curious person.

I mean "nosy person".

> 
> Regards, Szymon.
From: Rahul Jain
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87pt3clp42.fsf@nyct.net>
Szymon <············@o2.pl> writes:

> Szymon <············@o2.pl> writes:
>
>> Edi Weitz <········@agharta.de> writes:
>> 
>> > Why do you think you need MAKE-INSTANCE to do that?
>> 
>> I'm curious person.
>
> I mean "nosy person".

How on earth could any object in any OTHER language satisfy your
criterion for being an object? I don't see MAKE-INSTANCE in Java. Must
not have any way to make objects.

-- 
Rahul Jain
·····@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist
From: Svein Ove Aas
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <cl7lro$gfs$1@services.kq.no>
Rahul Jain wrote:

> Szymon <············@o2.pl> writes:
> 
>> Szymon <············@o2.pl> writes:
>>
>>> Edi Weitz <········@agharta.de> writes:
>>> 
>>> > Why do you think you need MAKE-INSTANCE to do that?
>>> 
>>> I'm curious person.
>>
>> I mean "nosy person".
> 
> How on earth could any object in any OTHER language satisfy your
> criterion for being an object? I don't see MAKE-INSTANCE in Java. Must
> not have any way to make objects.
> 
I see it now, the purpose of the question.
It's all a conspiracy to make people believe that Lisp is the only
object-oriented language in existence, and I don't think... hmm...
Go for it! 
From: Vladimir Sedach
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87lle1uzbw.fsf@shawnews.cg.shawcable.net>
Rahul Jain <·····@nyct.net> writes:
> Uh... I hope I'm missing some attempt at humor here...

Yes, that was my intention.

> EEK, Greenblatt! Don't scar the newbies! :)

That was supposed to be the punch line. :)

> > Q: What are the benefits of using Lisp comparing with other languages
> > of assembler paradigm?
> >
> > A: dpb, ldb
> 
> I don't see what that has to do with assembler. Those are bitwise
> operations, and lisp has lots more where those came from.

I decided to be clever. The question is the joke and the answer is
serious (if you didn't know, dpb and ldb are inspired by the PDP-10
instructions of the same names).

> In Lisp, all data are objects.

Well, when most people think of languages of the "object oriented"
paradigm, they think of a confused mess of types, data structures,
protocols and message passing. They also have this paranoid "will
someone think of the children?!!" hysteria about data hiding/hoarding
(hence the (setf (slot-value...). Lisp lets you keep these things
straight.

Vladimir
From: Rahul Jain
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87lle0lor2.fsf@nyct.net>
Vladimir Sedach <(string-downcase (concatenate 'string last-name (subseq first-name 0 1)))@cpsc.ucalgary.ca> writes:

> Rahul Jain <·····@nyct.net> writes:
>> Uh... I hope I'm missing some attempt at humor here...
>
> Yes, that was my intention.

Fair enough, heh.

>> EEK, Greenblatt! Don't scar the newbies! :)
>
> That was supposed to be the punch line. :)

It definitely causes pain if you're not prepared for it. ;)

>> > Q: What are the benefits of using Lisp comparing with other languages
>> > of assembler paradigm?
>> >
>> > A: dpb, ldb
>> 
>> I don't see what that has to do with assembler. Those are bitwise
>> operations, and lisp has lots more where those came from.
>
> I decided to be clever. The question is the joke and the answer is
> serious (if you didn't know, dpb and ldb are inspired by the PDP-10
> instructions of the same names).

Ah, but then it wouldn't be a benefit compared to PDP-10 assembler,
would it? (Then again, the PDP-10's LDB and DPB probably would be
limited to operating on the 36 bits in a word.)

Still, there are much better ways to show how Lisp helps you deal with
direct machine manipulation.

>> In Lisp, all data are objects.
>
> Well, when most people think of languages of the "object oriented"
> paradigm, they think of a confused mess of types, data structures,
> protocols and message passing. They also have this paranoid "will
> someone think of the children?!!" hysteria about data hiding/hoarding
> (hence the (setf (slot-value...). Lisp lets you keep these things
> straight.

Yes, in Lisp we have types, scopes, and namespaces as separate language
constructs. This is why neither scoping nor namespacing is restricted by
the type system. Note that Java lets you set private slot values from
anywhere, too (modulo security manager restrictions).

Nevertheless, the fact that namespacing and scoping are controlled
outside of the object system isn't a benefit of the object system, it's
a benefit of the basic language. :)

-- 
Rahul Jain
·····@nyct.net
Professional Software Developer, Amateur Quantum Mechanicist
From: Tayssir John Gabbour
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <866764be.0410200242.4502001d@posting.google.com>
········@gmail.com (Lorena Santana) wrote in message news:<····························@posting.google.com>...
> What are the programming paradigms in Lisp? I mean criteria of
> evaluation Lisp, such as: writability, readability, portability,
> reliability, etc? What are the benefits of using Lisp comparing with
> other languages of functional paradigm?

Useful interview:
http://slashdot.org/interviews/01/11/03/1726251.shtml
http://slashdot.org/interviews/01/11/13/0420226.shtml

I think you'll be happiest with these links, partly because when I
thought about your question, essentially this thought popped into my
head, which he states: "Language features are not a priori good or
bad. Rather, language features are good or bad in context, based on
how well they interact with other language features."

Your question almost seems like you want to be advocated to, which
luckily for you is not going to happen. Please feel free to give more
rather than less info, since we can't tailor you a good suit (is
Smalltalk better for your needs? Ruby? Ocaml?) without knowing your
measurements.


MfG,
Tayssir
From: Henry Lenzi
Subject: Re: Programming Paradigms in Lisp
Date: 
Message-ID: <87k6tbzl9l.fsf@sdhadjsjasdjs.com>
···········@yahoo.com (Tayssir John Gabbour) writes:

> ········@gmail.com (Lorena Santana) wrote in message news:<····························@posting.google.com>...
> > What are the programming paradigms in Lisp? I mean criteria of
> > evaluation Lisp, such as: writability, readability, portability,
> > reliability, etc? What are the benefits of using Lisp comparing with
> > other languages of functional paradigm?
> 
(snip)
> head, which he states: "Language features are not a priori good or
> bad. Rather, language features are good or bad in context, based on
> how well they interact with other language features."
> 
> MfG,
> Tayssir

 Hi-

 I'd also like to remind Lorena that Common Lisp has amazing development environments.
 There's no comparing them to the other environments for functional languages,
 except (possibly) the one for Bigloo (of which I know little).
 They're proprietary, but she can download and use them like "free as in beer."
- http:// www.franz.com
- http:// www.lispworks.com
- http://www.digitool.com/
- SLIME + your favorite open-source lisp.

Cheers,

Henry Lenzi