In article <·······················@g43g2000cwa.googlegroups.com>,
············@gmail.com wrote:
> Why is lisp not included as a functional language on this page?
>
> http://www.cs.nott.ac.uk/~gmh//faq.html#languages
Lisp is not generally considered a functional language, it's an
imperative language. We make extensive use of variable assignments,
modifying composite objects (e.g. SETF of CAR, structure slots, etc.),
and functions with side effects.
--
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Barry Margolin <······@alum.mit.edu> writes:
> In article <·······················@g43g2000cwa.googlegroups.com>,
> ············@gmail.com wrote:
>
>> Why is lisp not included as a functional language on this page?
>>
>> http://www.cs.nott.ac.uk/~gmh//faq.html#languages
>
> Lisp is not generally considered a functional language, it's an
> imperative language. We make extensive use of variable assignments,
> modifying composite objects (e.g. SETF of CAR, structure slots, etc.),
> and functions with side effects.
On the other hand, C can be considered a functional language, I make no
use of variable assignments or modifying composite objects:
#include <greenspun.h>
obj rev(obj lst,obj res){
if(null(lst)){
return(res);}
else{
return(rev(cdr(lst),cons(car(lst),res)));}}
obj reverse(obj lst){return(rev(lst,nil));}
obj mapcar(obj fun,obj lst){
if(null(lst)){
return(nil);}
else{
return(cons(funcall(fun,car(lst)),mapcar(fun,cdr(lst))));}}
int main(void){
print(mapcar(make-fun-obj(reverse),
list(list(cint(1),cint(2),cint(3),eoa),
list(cstring("a"),cstring("b"),cstring("c"),eoa)
list(nil,list(nil,eoa),list(list(nil,eoa),eoa),eoa),
eoa)));
return(0);}
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
__Pascal Bourguignon__ http://www.informatimago.com/
In article <··············@thalassa.informatimago.com>,
Pascal Bourguignon <····@mouse-potato.com> wrote:
> On the other hand, C can be considered a functional language, I make no
> use of variable assignments or modifying composite objects:
You can program in functional style with most languages, but that
doesn't make them functional languages. A functional language is one
where the functional style is the primary paradigm, and the language
encourages it and discourages non-functional programming.
--
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
Barry Margolin wrote:
> In article <··············@thalassa.informatimago.com>,
> Pascal Bourguignon <····@mouse-potato.com> wrote:
>
>
>>On the other hand, C can be considered a functional language, I make no
>>use of variable assignments or modifying composite objects:
>
>
> You can program in functional style with most languages,...
I know what you mean, but the key to me is that every form returns a
value, not the case with most languages. The OP (or an early respondent)
used (setf x (yada yada)) as an example of imperative, but that too
returns a value. That means I can code:
(make-instance 'blah :blah (any-builtin-lisp-operator .....))
...whereas in C that works only with user functions.
--
Kenny
Why Lisp? http://wiki.alu.org/RtL_Highlight_Film
"I've wrestled with reality for 35 years, Doctor, and I'm happy to state
I finally won out over it."
Elwood P. Dowd, "Harvey", 1950
Kenny Tilton wrote:
> Barry Margolin wrote:
>> Pascal Bourguignon <····@mouse-potato.com> wrote:
>>
>>> On the other hand, C can be considered a functional language, I make no
>>> use of variable assignments or modifying composite objects:
>>
>> You can program in functional style with most languages,...
>
> I know what you mean, but the key to me is that every form returns a
> value, not the case with most languages.
Also, that you can return closures.
Paul
············@gmail.com wrote:
> Why is lisp not included as a functional language on this page?
>
> http://www.cs.nott.ac.uk/~gmh//faq.html#languages
Firstly, that is not exactly a ``page'', but an HTML version of the
frequently asked questions list for the comp.lang.functional newsgroup.
Did you notice that?
Look what it says at the bottom of that FAQ: ``All questions, comments,
corrections, and suggestions regarding this document should be
addressed to the current editor, Graham Hutton.''
I think you have confused comp.lang.lisp for Graham Hutton's mailbox.
If you are going to post to Usenet to discuss a Usenet FAQ, why don't
you pick the matching newsgroup that the FAQ belongs to?
Strange ...