[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Re: Lisp Question

William James

1/20/2016 11:19:00 AM

Barry Margolin wrote:

> > What would be the simplest/quickest method
> > of adding an extra set of brackets t o any
> > sublist's within an initial list?
> >
> >
> > e.g.
> >
> > (addbrac '(a b c (d e f (g h) i) jk))
> > --> ((a b c ((d e f ((g h)) i)) jk))
>
> Untested:

Untested because he doesn't use CL?

Why not?

If CL (COBOL-Like) is a great language, then one would use it
even if he weren't paid to.

This tends to confirm that CL is a crappy language.

>
> (defun addbrac (thing)
> (if (atom thing) thing
> (list (mapcar #'addbrac thing))))


--
I am not certain what we should fear more, a street full of
soldiers who are out to plunder, or a room full of writers who
are used to lie. --- Samuel Johnson