From: Bruno Gustavs
Subject: Top 10 Language Constructs (Lisp)
Date: 
Message-ID: <8kmjt3$lfd$1@pollux.ip-plus.net>
What do you think are the top ten language constructs in Lisp?
Please don't answer in terms of concepts, but try to restrict
yourself to those statements you really use to cope with your
daily work.

Curious why I'm asking this question? In spite of all requirements
engineering effort we know exactly *how* to solve problems
with computer languages but know fairly, *what* we're doing
during this process.

Regards
Bruno Gustavs

From: Kent M Pitman
Subject: Re: Top 10 Language Constructs (Lisp)
Date: 
Message-ID: <sfwvgy8k4ir.fsf@world.std.com>
"Bruno Gustavs" <········@ch.sibt.com> writes:

> What do you think are the top ten language constructs in Lisp?

I didn't spend a lot of thought on this, but these come to mind.
There are more than 10.  And I'm sure I left some out.  Oh well.
Rich language...

defmacro   unwind-protect  mapcar   getf                restart-case
defmethod  funcall         loop     destructuring-bind  with-open-file
setf       typep           format   handler-bind        with-output-to-string
From: David Bakhash
Subject: Re: Top 10 Language Constructs (Lisp)
Date: 
Message-ID: <c29u2dslh5x.fsf@mint-square.mit.edu>
Kent M Pitman <······@world.std.com> writes:

> "Bruno Gustavs" <········@ch.sibt.com> writes:
> 
> > What do you think are the top ten language constructs in Lisp?
> 
> I didn't spend a lot of thought on this, but these come to mind.
> There are more than 10.  And I'm sure I left some out.  Oh well.
> Rich language...
> 
> defmacro   unwind-protect  mapcar   getf                restart-case
> defmethod  funcall         loop     destructuring-bind  with-open-file
> setf       typep           format   handler-bind        with-output-to-string

I have to ask...

why mapcar _and_ loop?

_some_ of mine are:

defmacro		; macros
loop			; iteration
cond			; control
defclass		; OO structure
defmethod		; OO functionality
typep			; rich type system
let			; binding
apply			; functional programming
setf			; mutation

dave
From: Kent M Pitman
Subject: Re: Top 10 Language Constructs (Lisp)
Date: 
Message-ID: <sfw66q8frmb.fsf@world.std.com>
David Bakhash <·····@alum.mit.edu> writes:

> Kent M Pitman <······@world.std.com> writes:
> 
> > "Bruno Gustavs" <········@ch.sibt.com> writes:
> > 
> > > What do you think are the top ten language constructs in Lisp?
> > 
[...]
> > defmacro   unwind-protect  mapcar   getf                restart-case
> > defmethod  funcall         loop     destructuring-bind  with-open-file
> > setf       typep           format   handler-bind        with-output-to-string
> 
> I have to ask...
> 
> why mapcar _and_ loop?

Because they each illustrate a wholly different and independently useful 
paradigm.  LOOP is specifically about the messy interactions between complex
sets of data traversals, filtering, and accumulation happening at the same
time.  When you have only a single one ongoing, MAPCAR is fine and useful,
but LOOP addresses a need not otherwise addressed... even if it is 
syntactically tricky in many of the cases where it's most useful.
From: Joachim Pimiskern
Subject: Re: Top 10 Language Constructs (Lisp)
Date: 
Message-ID: <8kmnhr$j1$1@proxy2.fe.internet.bosch.de>
Hi Bruno,

Bruno Gustavs schrieb in Nachricht <············@pollux.ip-plus.net>...
>What do you think are the top ten language constructs in Lisp?
>Please don't answer in terms of concepts, but try to restrict
>yourself to those statements you really use to cope with your
>daily work.
>
>Curious why I'm asking this question? In spite of all requirements
>engineering effort we know exactly *how* to solve problems
>with computer languages but know fairly, *what* we're doing
>during this process.


for each programming language there is a nucleus that
enables a programmer to implement a turing machine
(and thus be able to solve any computational problem).

I would choose setq, cons, cond, eql as basic functions
and symbol and integer as data types. A couple of
arithmetic functions are necessary, but it'll be
far more than ten.

Greetings,
Joachim
From: Frode Vatvedt Fjeld
Subject: Re: Top 10 Language Constructs (Lisp)
Date: 
Message-ID: <2hr98x2ekt.fsf@dslab7.cs.uit.no>
"Bruno Gustavs" <········@ch.sibt.com> writes:

> What do you think are the top ten language constructs in Lisp?
> Please don't answer in terms of concepts, but try to restrict
> yourself to those statements you really use to cope with your daily
> work.

My favorite would have to be UNDWIND-PROTECT. To me, it provides the
missing link between functional and imperative programming, enabling
me to blend the two nicely. But I don't actually _type_ it much,
because it's usually wrapped in some macro.

So DEFMACRO would also be a statment that ranks high, as it allows me
to have both readable and complex code at the same time.

-- 
Frode Vatvedt Fjeld
From: BG
Subject: Re: Top 10 Language Constructs (Lisp)
Date: 
Message-ID: <39720C53.60003308@microsoft.com>
Bruno Gustavs wrote:
> 
> What do you think are the top ten language constructs in Lisp?
> Please don't answer in terms of concepts, but try to restrict
> yourself to those statements you really use to cope with your
> daily work.
> 
> Curious why I'm asking this question? In spite of all requirements
> engineering effort we know exactly *how* to solve problems
> with computer languages but know fairly, *what* we're doing
> during this process.
> 
> Regards
> Bruno Gustavs

I think defmacro is one of my favorites because you are able to bend
lisp
to whatever language you ever dreamt of. (see "OnLisp" for details ;-)

I also like to use "labels"-recursion for some iteration-problems.
By the use of recursion I'am able to count my iteration-variables
on very different ways (depending on the actual state of the
computation)

In languages like C you have to use break, continue and/or special
in-loop
arithmetics to reach that functionality. With recursion the solution is
short
and descriptive.

It could be that some people will flame me, saying that using recursion
this way
is much to "scheme-like" in a CommonLisp with constructs like "loop" but
I would
tend to say that recursion is much more Lisp-like than most
iteration-constructs.
(That doesn't mean that I don't use the extended loop facility, dolist
or such constructs)

By the use of "labels" the compiler gives me good iterative code out of
this
recursive written code. 

(defun make-char-in-seq-p (char-seq)
  #'(lambda (a-char)
    (find a-char char-seq)))

(defun tokenize-string (str &optional (del '(#\Space))
			&key (start 0) (end nil))
  (labels ((rec (pos acc)
	   (if (null pos)
		(nreverse acc)
               (let ((tpos (position-if (make-char-in-seq-p del)
                                        str :start pos)))
                     (if (null tpos)
                        (nreverse (cons (subseq str pos) acc))
                      (rec (position-if-not (make-char-in-seq-p del)
                                             str :start tpos)
                           (cons (subseq str pos tpos) acc)))))))
     (rec (position-if-not (make-char-in-seq-p del)
                            str :start start :end end) '())))

This code runs on my cmucl with the same speed and consing like the
equvivalent "loop"
function.

sincerely Yours,
Jochen Schmidt <···@dataheaven.de>
From: BG
Subject: Re: Top 10 Language Constructs (Lisp) (Sorry)
Date: 
Message-ID: <39721105.77B3A405@dataheaven.de>
Sorry, but some "funny" person has fiddlet around
with my "personality" Settings in Netscape

To make it clear: I'm _not_ Bill Gates (Thanks god!)

sincerely Yours,
Jochen Schmidt <···@dataheaven.de>