Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion rant: LISP is non-functional!

Received: by 10.68.221.4 with SMTP id qa4mr16181370pbc.7.1330909219693;
        Sun, 04 Mar 2012 17:00:19 -0800 (PST)
MIME-Version: 1.0
Path: h9ni40184pbe.0!nntp.google.com!news2.google.com!goblin1!goblin2!goblin.stu.neva.ru!aioe.org!.POSTED!not-for-mail
From: Kaz Kylheku <k...@kylheku.com>
Newsgroups: comp.lang.lisp
Subject: Re: rant: LISP is non-functional!
Date: Mon, 5 Mar 2012 01:00:18 +0000 (UTC)
Organization: Aioe.org NNTP Server
Lines: 26
Message-ID: <20120304162612.158@kylheku.com>
References: <e67d3f03-1af7-4daf-94f6-85153b3f0856@qb4g2000pbb.googlegroups.com>
 <13373082.196.1330886061306.JavaMail.geo-discussion-forums@vbhv6>
 <jj0iq102vfv@enews6.newsguy.com>
NNTP-Posting-Host: X+c6YNb3AaWMPA3YfA4opg.user.speranza.aioe.org
X-Complaints-To: abuse@aioe.org
User-Agent: slrn/pre1.0.0-18 (Linux)
X-Notice: Filtered by postfilter v. 0.8.2

On 2012-03-04, WJ <w_a_x_...@yahoo.com> wrote:
> Antsan wrote:
>
>> I didn't know Lisp was supposed to be purely functional. And I also didn't
>> know that using lists somehow made functional programming impossible. This
>> is even more puzzling to me, as I never ever used a modifying function on a
>> list, as I see no reason to do that - as opposed to modifying arrays.
>
> You never used push, pop, or sort?

Bzzt: push and pop don't modify lists. They modify places.
(Of course, they can modify a list if you make a lsit place their
target, e.g. (pop (cdr list)) or (push 42 (third list))).

I.e. push and pop show that not only is functional programming possible
on lists, but also a kind of imperative programming that never destroys
lists.

(Let us coin a new word: "funperative programming". This is a style whereby
mutations are restricted to local variables, and data structures that
are guarnateed not to be shared because they were locally allocated in
the same scope. Functions written in funperative style appear functional
to outsiders, but have pragmatic innards.)

Maybe Antsan has a non-destructive sort routine which returns a newly allocated
sorted list. This is easy to write "funperatively": copy-list followed by sort.