From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 107f24,626a0a064b320310 X-Google-Attributes: gid107f24,public X-Google-Thread: f4fd2,626a0a064b320310 X-Google-Attributes: gidf4fd2,public X-Google-Thread: 103d24,626a0a064b320310 X-Google-Attributes: gid103d24,public X-Google-Thread: 1164ba,626a0a064b320310 X-Google-Attributes: gid1164ba,public X-Google-Thread: 114809,626a0a064b320310 X-Google-Attributes: gid114809,public X-Google-Thread: 10259a,626a0a064b320310 X-Google-Attributes: gid10259a,public X-Google-Thread: 103376,ea8ea502d35ca2ce X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-14 12:59:32 PST Path: archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!cpk-news-hub1.bbnplanet.com!cambridge1-snf1.gtei.net!news.gtei.net!bos-service1.ext.raytheon.com!bos-service2.ext.raytheon.com.POSTED!not-for-mail Sender: jk@sysengr.res.ray.com Newsgroups: comp.lang.ada,comp.lang.lisp,comp.lang.smalltalk,comp.lang.basic,comp.lang.functional,comp.lang.scheme,comp.lang.perl Subject: Re: Beginner's Language? References: <9cukad$nn68@news-dxb> <9d6b6e$1bt$1@nh.pace.co.uk> <87snihxiwc.fsf@frown.here> <9dbi83$sji$1@nh.pace.co.uk> <87heyu7cqd.fsf@frown.here> <9dc20p$hh15e$1@ID-37382.news.dfncis.de> From: Johan Kullstam Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 14 May 2001 15:58:17 -0400 NNTP-Posting-Host: 138.125.142.46 X-Complaints-To: news@ext.ray.com X-Trace: bos-service2.ext.raytheon.com 989870368 138.125.142.46 (Mon, 14 May 2001 15:59:28 EDT) NNTP-Posting-Date: Mon, 14 May 2001 15:59:28 EDT Organization: Raytheon Company Xref: archiver1.sj.google.com comp.lang.ada:7497 comp.lang.lisp:10035 comp.lang.smalltalk:9666 comp.lang.functional:5637 comp.lang.scheme:3795 comp.lang.perl:2736 Date: 2001-05-14T15:58:17-04:00 List-Id: a.krennmair@aon.at (Andreas Krennmair) writes: > Friedrich Dominicus wrote: > > "Marin David Condic" writes: > > > > > > If you are familiar with Lisp, try this: Write a small program to read in a > > > couple of numbers from a keyboard, do some math with them and print the > > > result to the screen. > > Gosh, how much simpler as in Lisp can it be? No declarations, no > > puzzling about counting probably etc etc. > The problem is that Lisp is in no way similar to a natural language. And > natural language can be understood easier than some functional, theoretical > stuff with a unique concept like Lisp. Don't get me wrong, Lisp is a great > language, and I personally find it quite exciting as four year Pascal and > two year C/C++ programmer, but it's hardly usable for teaching, because it > is so unique (well, you _could_ to functional programming in C, but it would > be considered bad style). in C, functions are not first class objects; you cannot do functional programming in C. example 1 how do i take a function of two args in C and pass it to a function which expects a funciton of only one arg? (defun foo (x y) (...)) (bar #'(lambda (u) (foo u 4))) in C, this can be kluged by using a global variable and a named helper function which accesses the global and calls foo. it's very ugly and not re-entrant. example 2 how do i have a function *create* and return a *function*? (defun power-function (power) #'(lambda (x) (expt x power))) now use it to get lisp> (mapcar (power-function 3) '(1 2 3)) (1 8 27) afaik this cannot be done in C at all. -- J o h a n K u l l s t a m [kullstam@ne.mediaone.net] sysengr