From toy@rtp.ericsson.se Mon Nov 2 09:11:30 1998 Received: from gwa.ericsson.com (gwa.ericsson.com [198.215.127.2]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id JAA11436 for ; Mon, 2 Nov 1998 09:11:26 -0800 (PST) Received: from mr3.exu.ericsson.se ([138.85.11.55]) by gwa.ericsson.com (8.8.8/8.8.8) with ESMTP id LAA02857; Mon, 2 Nov 1998 11:26:13 -0600 (CST) Received: from netmanager7.rtp.ericsson.se (netmanager7.rtp.ericsson.se [147.117.132.245]) by mr3.exu.ericsson.se (8.8.8/8.8.8) with SMTP id LAA05444; Mon, 2 Nov 1998 11:26:13 -0600 (CST) Received: from rcur (wcsdsp4 [147.117.132.216]) by netmanager7.rtp.ericsson.se (8.6.12/8.6.4) with ESMTP id MAA02313; Mon, 2 Nov 1998 12:26:12 -0500 To: clisp-list@seagull.cons.org cc: Multiple recipients of list References: <199810311047.LAA11991@janet.unipi.it> Subject: Re: compiler In-reply-to: (Your message of Sat, 31 Oct 1998 02:39:31 PST.) <199810311047.LAA11991@janet.unipi.it> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII Date: Mon, 02 Nov 1998 12:26:12 -0500 Message-ID: <15532.910027572@rtp.ericsson.se> From: Raymond Toy >>>>> "Giuseppe" == Giuseppe Attardi writes: Giuseppe> As far as I remember, CLISP discards most type information, and adding Giuseppe> type analysis is definitely a major undertaking. Perhaps we can steal most of this from CMUCL? Ray From aler@inf.uc3m.es Wed Nov 4 09:26:29 1998 Received: from elrond.uc3m.es (elrond.uc3m.es [163.117.136.62]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id JAA05043 for ; Wed, 4 Nov 1998 09:26:10 -0800 (PST) Received: from tristan.uc3m.es (aler@tristan.uc3m.es [163.117.129.72]) by elrond.uc3m.es (8.8.5/8.8.5) with SMTP id SAA00688 for ; Wed, 4 Nov 1998 18:49:06 GMT Date: Wed, 4 Nov 1998 18:41:16 +0100 (CET) From: Ricardo Aler Mur X-Sender: aler@tristan.uc3m.es Reply-To: aler@inf.uc3m.es To: clisp-list@seagull.cons.org Subject: Re: compiler In-Reply-To: <199810221833.UAA01952@jaures.ilog.fr> Message-ID: Distribution: world MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Thu, 22 Oct 1998, Bruno Haible wrote: > Hmm. I estimate the speed gain of using a native compiler like CMUCL [1] > to be a factor 5 or so. This would be incredibly useful, as I have to carry out experiments that last for days. I just tried cmucl and clisp with a genetic programming system and as far as I can se, clisp is faster and uses far less memory. There is no number crunching nor type declarations in the code, though. Cmucl seems to spend most of its time gc-ing. Ricardo. -------- mailto: "Ricardo Aler Mur" http://grial.uc3m.es/~aler From joswig@lavielle.com Wed Nov 4 21:12:23 1998 Received: from vampire.lavielle.com (vampire.lavielle.com [194.64.21.10]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id VAA00952 for ; Wed, 4 Nov 1998 21:12:22 -0800 (PST) Received: from [194.64.21.18] ([194.163.195.67]) by vampire.lavielle.com (8.8.8/8.8.8) with ESMTP id GAA19096 for ; Thu, 5 Nov 1998 06:13:19 +0100 (MET) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Sender: joswig@194.64.21.10 Message-Id: In-Reply-To: Date: Thu, 5 Nov 1998 06:12:08 +0100 To: clisp-list@clisp.cons.org From: Rainer Joswig Subject: Re: compiler At 9:28 Uhr -0800 04.11.1998, Ricardo Aler Mur wrote: >There is no number crunching nor type declarations in the code, though. >Cmucl seems to spend most of its time gc-ing. Typical problem with the old GC. You need to tune the GC settings. Additionally doing less consing is another option. I haven't tried that, but the new GC for CMUCL 18b under Linux/FreeBSD should be better. Rainer Joswig, Lavielle EDV Systemberatung GmbH & Co, Lotharstrasse 2b, D22041 Hamburg, Tel: +49 40 658088, Fax: +49 40 65808-202, Email: joswig@lavielle.com , WWW: http://www.lavielle.com/~joswig/ From yoda@isr.isr.ist.utl.pt Thu Nov 5 08:49:15 1998 Received: from isr.isr.ist.utl.pt (isr.isr.ist.utl.pt [193.136.138.1]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id IAA06080 for ; Thu, 5 Nov 1998 08:48:59 -0800 (PST) Received: from magalhaes.isr.ist.utl.pt (magalhaes [193.136.138.9]) by isr.isr.ist.utl.pt (8.8.8/8.8.8) with SMTP id QAA09494 for ; Thu, 5 Nov 1998 16:49:03 +0100 (GMT+0100) Received: by magalhaes.isr.ist.utl.pt (5.65v3.2/1.1.10.5/12Dec97-1230PM) id AA02371; Thu, 5 Nov 1998 16:51:01 GMT Date: Thu, 5 Nov 1998 16:51:01 GMT Message-Id: <9811051651.AA02371@magalhaes.isr.ist.utl.pt> From: Rodrigo Ventura To: clisp-list@seagull.cons.org In-Reply-To: Ricardo Aler Mur's message of Wed, 4 Nov 1998 09:29:46 -0800 (PST) Subject: Re: compiler References: Mime-Version: 1.0 (generated by tm-edit 7.95) Content-Type: text/plain; charset=US-ASCII >>>>> "Ricardo" == Ricardo Aler Mur writes: Ricardo> This would be incredibly useful, as I have to carry out experiments that Ricardo> last for days. I just tried cmucl and clisp with a genetic programming Ricardo> system and as far as I can se, clisp is faster and uses far less memory. Ricardo> There is no number crunching nor type declarations in the code, though. Ricardo> Cmucl seems to spend most of its time gc-ing. My experience tells me the same. I tried CMUCL a couple of times, and in fact I got quite impressed with its speed in small-number tight-loop algorithms. Simple numerical stuff simply flies on CMUCL. But then I tried two programs that made CMUCL unusable as far as my needs: a agent-based programming language for problem solving, where it spent all the time GC'ing (there was some sort of context switching between the agents), and a dead-simple recursive factorial function, that made CMUCL core dump with large numbers. It seems that the tradeof of having assembly-level compilation is the weakness of the memory management system. The whole CMUCL system is quite huge, and it makes sense to ask if the extra megas of sources (in comparasion with CLISP, for instance) do payback. Extra complexity usually throws the expected advantage it is supposed to bring. Regards, -- -- *** Rodrigo Martins de Matos Ventura, alias *** yoda@isr.ist.utl.pt, http://www.isr.ist.utl.pt/~yoda *** Instituto de Sistemas e Robotica, Polo de Lisboa *** Instituto Superior Tecnico, Lisboa, Portugal *** PGP Public Key available on my homepage *** Key fingerprint = 0C 0A 25 58 46 CF 14 99 CF 9C AF 9E 10 02 BB 2A From ecm@savage.iut-blagnac.fr Tue Nov 10 03:30:59 1998 Received: from savage.iut-blagnac.fr (savage.iut-blagnac.fr [193.54.227.231]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id DAA03199 for ; Tue, 10 Nov 1998 03:30:56 -0800 (PST) Received: by savage.iut-blagnac.fr via sendmail from stdin id (Debian Smail3.2.0.101) for clisp-list@seagull.cons.org; Tue, 10 Nov 1998 12:31:16 +0100 (CET) Message-ID: <19981110123116.A13909@savage.iut-blagnac.fr> Date: Tue, 10 Nov 1998 12:31:16 +0100 From: Eric Marsden To: clisp-list@seagull.cons.org Subject: Dynamic loading of shared libraries? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.2 X-Attribution: ecm X-Eric-Conspiracy: There is no conspiracy. Organization: disorganized Has anyone worked on allowing CLISP to load shared libraries at runtime? Last night I was all happy at having compiled the dlfcn routines as a module, but I realized a little belatedly that the tricky bit is argument passing to foreign routines. Is this too difficult technically? -- Eric Marsden emarsden @ mail.dotcom.fr It's elephants all the way down From haible@ilog.fr Tue Nov 10 05:21:00 1998 Received: from sceaux.ilog.fr (sceaux.ilog.fr [193.55.64.10]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id FAA04146 for ; Tue, 10 Nov 1998 05:20:57 -0800 (PST) Received: from ilog.ilog.fr ([172.17.4.22]) by sceaux.ilog.fr (8.8.8/8.8.7) with ESMTP id OAA00362 for ; Tue, 10 Nov 1998 14:21:32 +0100 (MET) Received: from jaures.ilog.fr (jaures.ilog.fr [172.16.1.81]) by ilog.ilog.fr (8.8.8/8.7.3) with ESMTP id OAA16905; Tue, 10 Nov 1998 14:21:28 +0100 (MET) From: Bruno Haible Received: (from haible@localhost) by jaures.ilog.fr (8.9.0/8.9.0) id OAA08676; Tue, 10 Nov 1998 14:21:28 +0100 (MET) Date: Tue, 10 Nov 1998 14:21:28 +0100 (MET) Message-Id: <199811101321.OAA08676@jaures.ilog.fr> To: clisp-list@seagull.cons.org Subject: Re: Dynamic loading of shared libraries? In-Reply-To: <19981110123116.A13909@savage.iut-blagnac.fr> References: <19981110123116.A13909@savage.iut-blagnac.fr> Eric Marsden writes: > Has anyone worked on allowing CLISP to load shared libraries at runtime? > Last night I was all happy at having compiled the dlfcn routines as a > module, but I realized a little belatedly that the tricky bit is argument > passing to foreign routines. Is this too difficult technically? Passing arguments to foreign routines is best (and more portably) done through CLISP's FFI. For example, the modules/regexp/ code is just a wrapper around the GNU regexp routines, and the interface is made by the following declarations: (def-c-type size_t uint) (def-c-type regex_t-ptr c-pointer) ; Types exported by regex.h: (def-c-type regoff_t int) (def-c-struct regmatch_t (rm_so regoff_t) (rm_eo regoff_t) ) (def-c-call-out mregcomp (:arguments (ppreg (c-ptr regex_t-ptr) :out) (pattern c-string) (cflags int) ) (:return-type int) ) (def-c-call-out regexec (:arguments (preg regex_t-ptr) (string c-string) (nmatch size_t) (pmatch (c-ptr (c-array regmatch_t #.num-matches)) :out) (eflags int) ) (:return-type int) ) (def-c-call-out mregerror (:arguments (errcode int) (preg regex_t-ptr) ) (:return-type c-string :malloc-free) ) (def-c-call-out mregfree (:arguments (preg regex_t-ptr)) (:return-type nil) ) The syntax of these declarations is described in foreign.txt and impnotes.html. Bruno From amoroso@mclink.it Tue Nov 10 07:34:02 1998 Received: from mail1.mclink.it (net128-007.mclink.it [195.110.128.7]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id HAA05407 for ; Tue, 10 Nov 1998 07:33:12 -0800 (PST) Received: from net145-041.mclink.it (net145-041.mclink.it [195.110.145.41]) by mail1.mclink.it (8.9.1/8.9.0) with SMTP id QAA07260 for ; Tue, 10 Nov 1998 16:33:29 +0100 (CET) From: amoroso@mclink.it (Paolo Amoroso) To: clisp-list@seagull.cons.org Subject: Re: Dynamic loading of shared libraries? Date: Tue, 10 Nov 1998 15:32:30 GMT Organization: Paolo Amoroso - Milan, ITALY Message-ID: <364857fe.388999@mail.mclink.it> References: <199811101321.OAA08676@jaures.ilog.fr> In-Reply-To: <199811101321.OAA08676@jaures.ilog.fr> X-Mailer: Forte Agent 1.5/32.451 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit On Tue, 10 Nov 1998 05:21:27 -0800 (PST), you wrote: > Eric Marsden writes: > > Has anyone worked on allowing CLISP to load shared libraries at runtime? [...] > Passing arguments to foreign routines is best (and more portably) done > through CLISP's FFI. For example, the modules/regexp/ code is just a [...] This is handy but, if I get things right, C wrappers and an explicit compile/link phase are still required with CLISP. This process is managed by clisp-link. Compare this to the FFI of the Scheme system STk 3.99.x (http://kaolin.unice.fr/STk/). Since STk supports dynamic loading of shared libraries at runtime, all that is needed to use, for example, the standard C library function printf is: (define-external printf ((format :string) . l) :return-type :int) (printf ("This is a %s\n" "test")) STk takes care of transparently loading the appropriate system library at runtime. No C code or compile/link phase is required. Is this already possible with CLISP? If not, will it be? Paolo -- Paolo Amoroso From lindner@plopp.intellektik.informatik.tu-darmstadt.de Tue Nov 10 16:49:55 1998 Received: from plopp.intellektik.informatik.tu-darmstadt.de (plopp.intellektik.informatik.tu-darmstadt.de [130.83.26.29]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id QAA10869 for ; Tue, 10 Nov 1998 16:49:53 -0800 (PST) Received: (from lindner@localhost) by plopp.intellektik.informatik.tu-darmstadt.de (8.8.7/8.8.7) id BAA03792; Wed, 11 Nov 1998 01:50:28 +0100 From: Matthias Lindner MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <13896.57171.596747.514713@orion.plopp.de> Date: Wed, 11 Nov 1998 01:50:27 +0100 (MET) To: clisp-list@clisp.cons.org Subject: TCL<->Lisp Interface X-Mailer: VM 6.62 under 21.2 "Aglaia" XEmacs Lucid (beta3) Reply-To: matthias@intellektik.informatik.tu-darmstadt.de Hi, having received the second request for my WITH-WISHSERVER package, which connects a Lisp process to a tcl process via TCP/IP sockets, I think we have reached the critical mass of users to make the package available by ftp ;-) You can find it in ftp://aida.intellektik.informatik.tu-darmstadt.de/pub/plopp/ The relevant file is with-wishserver-.tar.gz. The old WITH-WISH package, which uses pipes and runs only on UNIX systems, is in the same place. Remember that WITH-WISHSERVER is an unfinished work-in-progress package. There is hardly any documentation but I will try to answer any questions you send me by e-mail. --Matthias ------------------------------------------------------------------------------- Matthias Lindner, Wilhelm-Leuschner-Str.46, 64293 Darmstadt, Germany Tel.: +49 6151 22071, E-Mail: matthias@intellektik.informatik.tu-darmstadt.de ------------------------------------------------------------------------------- From ecm@savage.iut-blagnac.fr Thu Nov 12 02:42:20 1998 Received: from savage.iut-blagnac.fr (savage.iut-blagnac.fr [193.54.227.231]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id CAA28198 for ; Thu, 12 Nov 1998 02:42:15 -0800 (PST) Received: by savage.iut-blagnac.fr via sendmail from stdin id (Debian Smail3.2.0.101) for clisp-list@seagull.cons.org; Thu, 12 Nov 1998 11:42:53 +0100 (CET) Message-ID: <19981112114253.A18908@savage.iut-blagnac.fr> Date: Thu, 12 Nov 1998 11:42:53 +0100 From: Eric Marsden To: clisp-list@seagull.cons.org Subject: Re: Dynamic loading of shared libraries? References: <199811101321.OAA08676@jaures.ilog.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.2 In-Reply-To: <199811101321.OAA08676@jaures.ilog.fr>; from Bruno Haible on Tue, Nov 10, 1998 at 05:21:19AM -0800 X-Attribution: ecm X-Eric-Conspiracy: There is no conspiracy. Organization: disorganized On Tue, Nov 10, 1998 at 05:21:19AM -0800, Bruno Haible wrote: > Passing arguments to foreign routines is best (and more portably) done > through CLISP's FFI. For example, the modules/regexp/ code is just a > wrapper around the GNU regexp routines, and the interface is made by > the following declarations: As Paolo noted, the FFI requires a compile/link phase. It would be nice if CLISP were able to load libraries dynamically. I worked on this yesterday, copying STk's mechanism, which implements the stack for argument passing as an array of fake_type, where fake_type is a union of the different types which are supported (long, int, char, pointer, float, double). There is a bit of trickiness about alignment with doubles, but it works for me on Linux/x86. Bruno is worried about portability, but I don't see this as a real problem: firstly dynamic linking is necessarily platform-dependant, secondly STk gets it to work on a fair range of Unixes (only by resorting to assembly for certain architectures), and thirdly it is only an add-on; people can always use the normal FFI on platforms which don't support dynamic loading. Does anyone have an idea for a better mechanism for accessing dynamic libraries? I have appended an example of the low-level interface below. What is needed now is a macro to define an external call, which will look after loading the library, resolving the symbol, and defining a Lisp function which pushes the arguments and calls the correct C-level function according to the return type. I am trying to figure out how macros work. (use-package "DL") (setq libc (dl::dlopen "libc.so.5" dl::RTLD_NOW)) (setq libm (dl::dlopen "libm.so.5" dl::RTLD_NOW)) (setq labs (dl::dlsym libm "labs")) ;; long int labs(long int j) (setq pow (dl::dlsym libm "pow")) ;; double pow(double x, double y) (setq getpid (dl::dlsym libc "getpid")) (terpri) (dl::init_external_call) (format t "Current process' PID is ~a~%" (dl::return_int getpid)) (dl::init_external_call) (dl::push_long -5) (format t "Absolute value of -5 is ~a~%" (dl::return_long labs)) (dl::init_external_call) (dl::push_double 2.0d0) (dl::push_double 3.0d0) (format t "2 ^ 3 = ~a~%" (dl::return_double pow)) -- Eric Marsden emarsden @ mail.dotcom.fr It's elephants all the way down From dtillman@palantir.cannonexpress.com Fri Nov 13 13:23:41 1998 Received: from palantir.cannonexpress.com (dtillman@palantir.cannonexpress.com [208.136.255.65]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id NAA15913 for ; Fri, 13 Nov 1998 13:23:39 -0800 (PST) Received: (from dtillman@localhost) by palantir.cannonexpress.com (8.8.7/8.8.7) id PAA04681; Fri, 13 Nov 1998 15:24:48 -0600 Date: Fri, 13 Nov 1998 15:24:48 -0600 Message-Id: <199811132124.PAA04681@palantir.cannonexpress.com> From: David Tillman To: clisp-list@clisp.cons.org Subject: fork I believe I have asked this before, but did not get a satisfactory answer. Is there a way to fork in CLISP? Thanks, Dave. From ecm@savage.iut-blagnac.fr Thu Nov 19 02:44:06 1998 Received: from savage.iut-blagnac.fr (savage.iut-blagnac.fr [193.54.227.231]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id CAA19430 for ; Thu, 19 Nov 1998 02:44:02 -0800 (PST) Received: by savage.iut-blagnac.fr via sendmail from stdin id (Debian Smail3.2.0.101) for clisp-list@clisp.cons.org; Thu, 19 Nov 1998 11:45:10 +0100 (CET) Message-ID: <19981119114509.A1444@savage.iut-blagnac.fr> Date: Thu, 19 Nov 1998 11:45:09 +0100 From: Eric Marsden To: Multiple recipients of list Subject: Re: Dynamic loading of shared libraries? References: <19981112114253.A18908@savage.iut-blagnac.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.91.2 In-Reply-To: <19981112114253.A18908@savage.iut-blagnac.fr>; from Eric Marsden on Thu, Nov 12, 1998 at 02:44:14AM -0800 X-Attribution: ecm X-Eric-Conspiracy: There is no conspiracy. Organization: disorganized My code implementing dynamic loading of shared libraries for CLISP using the dlopen() mechanism and an emulated stack is available for the adventurous. I have only tested it on Linux/x86, but with some hacking the same mechanisms should work on most Unix platforms and architectures. This release is mainly an invitation for comments from interested people; I am new to Common Lisp and would appreciate any suggestions on the code. http://www.chez.com/emarsden/downloads/dl0.1.tar.gz I am also working on an interface to the GD library which allows the programmatic generation of GIF images, using the DL module. -- Eric Marsden emarsden @ mail.dotcom.fr It's elephants all the way down From davep@hagbard.demon.co.uk Fri Nov 20 00:13:20 1998 Received: from post.mail.demon.net (post-20.mail.demon.net [194.217.242.27]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id AAA29385 for ; Fri, 20 Nov 1998 00:13:19 -0800 (PST) Received: from [158.152.34.118] (helo=hagbard.demon.co.uk) by post.mail.demon.net with esmtp (Exim 2.053 #1) id 0zgliX-0002z2-00 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 08:15:01 +0000 Received: (from davep@localhost) by hagbard.demon.co.uk (8.8.3/v3.2) id HAA03763 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 07:49:55 GMT Message-ID: <19981120074955.F31527@hagbard.demon.co.uk> Date: Fri, 20 Nov 1998 07:49:55 +0000 From: Dave Pearson To: clisp-list@clisp.cons.org Subject: Confused by #() in clisp Mail-Followup-To: clisp-list@clisp.cons.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1 Organization: Hagbard's World X-URL: http://www.acemake.com/hagbard/ X-OS: Linux 2.0.33 i586 First off I'll say that the following may simply be down to my lack of understanding of lisp, I dabble, that's all. I wonder if someone can explain why the following doesn't work with clisp? Correct me if I'm wrong but it is possible to "hard code" an array by doing something along the lines of: (setq a #(1 2 3 4)) and, if I do this in ACL or Corman Lisp it works fine. However, in clisp I get: > (setq a #(1 2 3 4)) *** - EVAL: illegal form #(1 2 3 4) 1. Break> Is there are simple reason for this or am I missing something obvious? The version of clisp I'm running is: > (lisp-implementation-version ) "1998-09-09 (September 1998)" -- Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader. http://www.acemake.com/hagbard/ | eg - Norton Guide reader for Linux. http://www.hagbard.demon.co.uk/ | weg - Norton Guide reader for Windows. Free software, including........| dgscan - DGROUP scanner for Clipper. From zbyszek@mimuw.edu.pl Fri Nov 20 01:18:51 1998 Received: from ghost.mimuw.edu.pl (ghost.mimuw.edu.pl [148.81.13.1]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id BAA00304 for ; Fri, 20 Nov 1998 01:18:39 -0800 (PST) Received: from [148.81.12.171] (pc4390a.mimuw.edu.pl [148.81.12.171]) by ghost.mimuw.edu.pl (8.7.5/8.7.3) with SMTP id KAA18383 for ; Fri, 20 Nov 1998 10:14:56 +0100 From: "Zbyszek Jurkiewicz" Date: Fri, 20 Nov 98 10:19:05 CST Message-Id: <152.zbyszek@ghost.mimuw.edu.pl_POPMail/PC_3.2.2> X-POPmail-Charset: English To: clisp-list@seagull.cons.org Subject: Re: Confused by #() in clisp On Fri, 20 Nov 1998 00:13:43 -0800 (PS, Dave Pearson wrote: >First off I'll say that the following may simply be down to my lack of >understanding of lisp, I dabble, that's all. > >I wonder if someone can explain why the following doesn't work with clisp? >Correct me if I'm wrong but it is possible to "hard code" an array by doing >something along the lines of: > > (setq a #(1 2 3 4)) > >and, if I do this in ACL or Corman Lisp it works fine. However, in clisp I >get: > >> (setq a #(1 2 3 4)) > >*** - EVAL: illegal form #(1 2 3 4) >1. Break> > >Is there are simple reason for this or am I missing something obvious? The >version of clisp I'm running is: > >> (lisp-implementation-version ) >"1998-09-09 (September 1998)" Simply use > (setq a '#(1 2 3 4)) #(1 2 3 4) In Clisp array constants must be quoted. Regards Zbyszek Jurkiewicz University of Warsaw From davep@hagbard.demon.co.uk Fri Nov 20 04:00:55 1998 Received: from post.mail.demon.net (post-12.mail.demon.net [194.217.242.41]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id EAA01788 for ; Fri, 20 Nov 1998 04:00:54 -0800 (PST) Received: from [158.152.34.118] (helo=hagbard.demon.co.uk) by post.mail.demon.net with esmtp (Exim 2.053 #1) id 0zgpGh-0003ku-00 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 12:02:33 +0000 Received: (from davep@localhost) by hagbard.demon.co.uk (8.8.3/v3.2) id LAA08981 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 11:04:32 GMT Message-ID: <19981120110431.I31527@hagbard.demon.co.uk> Date: Fri, 20 Nov 1998 11:04:31 +0000 From: Dave Pearson To: Multiple recipients of list Subject: Re: Confused by #() in clisp Mail-Followup-To: Multiple recipients of list References: <152.zbyszek@ghost.mimuw.edu.pl_POPMail/PC_3.2.2> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1 In-Reply-To: <152.zbyszek@ghost.mimuw.edu.pl_POPMail/PC_3.2.2>; from Zbyszek Jurkiewicz on Fri, Nov 20, 1998 at 01:19:10AM -0800 Organization: Hagbard's World X-URL: http://www.acemake.com/hagbard/ X-OS: Linux 2.0.33 i586 On Fri, Nov 20, 1998 at 01:19:10AM -0800, Zbyszek Jurkiewicz wrote: > On Fri, 20 Nov 1998 00:13:43 -0800 (PS, Dave Pearson wrote: > > >> (setq a #(1 2 3 4)) > > > >*** - EVAL: illegal form #(1 2 3 4) > >1. Break> > > > > Simply use > > > (setq a '#(1 2 3 4)) > #(1 2 3 4) > > In Clisp array constants must be quoted. Thanks, I notice that this works in ACL too. Is there any reason for this difference? -- Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader. http://www.acemake.com/hagbard/ | eg - Norton Guide reader for Linux. http://www.hagbard.demon.co.uk/ | weg - Norton Guide reader for Windows. Free software, including........| dgscan - DGROUP scanner for Clipper. From arvo@goblin.cs.caltech.edu Fri Nov 20 04:18:26 1998 Received: from csvax.cs.caltech.edu (csvax.cs.caltech.edu [131.215.131.131]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id EAA02069 for ; Fri, 20 Nov 1998 04:18:24 -0800 (PST) Received: from goblin.cs.caltech.edu (goblin.cs.caltech.edu [131.215.131.116]) by csvax.cs.caltech.edu (8.9.1/8.9.1) with SMTP id EAA25685; Fri, 20 Nov 1998 04:19:59 -0800 (PST) Received: (from arvo@localhost) by goblin.cs.caltech.edu (950413.SGI.8.6.12/950213.SGI.AUTOCF) id EAA10011; Fri, 20 Nov 1998 04:32:59 -0800 From: "Jim Arvo" Message-Id: <9811200432.ZM10009@goblin.cs.caltech.edu> Date: Fri, 20 Nov 1998 04:32:59 -0800 In-Reply-To: Dave Pearson "Confused by #() in clisp" (Nov 20, 12:14am) References: <19981120074955.F31527@hagbard.demon.co.uk> X-Mailer: Z-Mail (3.2.3 08feb96 MediaMail) To: clisp-list@seagull.cons.org Subject: Re: Confused by #() in clisp Cc: cs20@cs.caltech.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Correct me if I'm wrong but it is possible to "hard code" an array by doing > something along the lines of: > > (setq a #(1 2 3 4)) > > and, if I do this in ACL or Corman Lisp it works fine. However, in clisp I > get: > > > (setq a #(1 2 3 4)) > > *** - EVAL: illegal form #(1 2 3 4) > 1. Break> Does this really work in ACL? It shouldn't! Let me explain. What do you think would happen if you typed in (setq x (a b c)) ? Lisp would complain, right? The problem is that it's trying to evaluate the thing on the right. Even though it's a perfectly fine representation of a list, this causes an error. Same with (setq a #(1 2 3 4)) The thing on the right is a perfectly fine representation of a "vector", but SETQ is trying to *evaluate* it. You see, "#(" is a signal to the Lisp *reader* that what follows are elements of a vector. By the time SETQ sees it, it's already assembled, and SETQ tries to evaluate it. Error. If you try typing in (setq a '#(1 2 3 4)) you'll see that it works. Your confusion probably stems for the similarity with the notation #'foo, which is a shorthand for (function foo), which is something that indeed needs to be *evaluated*! -- Jim From yoda@isr.isr.ist.utl.pt Fri Nov 20 04:56:50 1998 Received: from isr.isr.ist.utl.pt (isr.isr.ist.utl.pt [193.136.138.1]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id EAA02570 for ; Fri, 20 Nov 1998 04:56:46 -0800 (PST) Received: from magalhaes.isr.ist.utl.pt (magalhaes [193.136.138.9]) by isr.isr.ist.utl.pt (8.8.8/8.8.8) with SMTP id MAA20725 for ; Fri, 20 Nov 1998 12:58:37 +0100 (GMT+0100) Received: by magalhaes.isr.ist.utl.pt (5.65v3.2/1.1.10.5/12Dec97-1230PM) id AA12585; Fri, 20 Nov 1998 13:00:32 GMT Date: Fri, 20 Nov 1998 13:00:32 GMT Message-Id: <9811201300.AA12585@magalhaes.isr.ist.utl.pt> From: Rodrigo Ventura To: clisp-list@seagull.cons.org In-Reply-To: "Jim Arvo"'s message of Fri, 20 Nov 1998 04:18:37 -0800 (PST) Subject: Re: Confused by #() in clisp References: <9811200432.ZM10009@goblin.cs.caltech.edu> Mime-Version: 1.0 (generated by tm-edit 7.95) Content-Type: text/plain; charset=US-ASCII Your explanation is quite illustrative, but I'm afraid it misses the point completely. For instance, following you line of reasoning, the correct way to add 1 with 2 would be (+ '1 '2). But in fact, 1 and 2 are considered by the _reader_ as self-evaluating constants! Recall that 'foobar means (quote foobar). The ' notation is just a reader macro, expanding to the quote form. Strings are another example of self-evaluating constants. The question is, why on the earth are arrays any different? For instance (from CLtL2) #o33 and #.(* 3 3 3) both evaluate to 27, and they are both readmacros. What is going on? I guess it is necessary to distinguish between the _reader_ and the _evaluator_. The reader reads numbers and vectors ok, the question is what shall the evaluator do with them. At page 70 of the CLtL2, Steele states: "All numbers, characters, strings, and bit-vectors are self-evaluating forms.[...] The empty list (), [...] is also a self-evaluating form. [...] Keywords ([...]) also evaluate to themselves" This is very clear to me, although I still do not understand why Steele does not mention arrays and vectors in that list. Did he forgot them? 8-) May I attempt an explanation? The list enumerated by Steele comprises only "small" objects, or objects that need no memory allocation, that can be stored in a machine word. Arrays, as well as vectors, need memory allocation, and therefore require an explicit quote. Maybe this is important to the compiler, to know how to deal with constants and inline constants. But this explanation fall far from the beauty of the abstract language. Best Regards, -- -- *** Rodrigo Martins de Matos Ventura, alias *** yoda@isr.ist.utl.pt, http://www.isr.ist.utl.pt/~yoda *** Teaching Assistant and MSc. Student at ISR: *** Instituto de Sistemas e Robotica, Polo de Lisboa *** Instituto Superior Tecnico, Lisboa, Portugal *** PGP Public Key available on my homepage *** Key fingerprint = 0C 0A 25 58 46 CF 14 99 CF 9C AF 9E 10 02 BB 2A From joswig@lavielle.com Fri Nov 20 05:00:19 1998 Received: from vampire.lavielle.com (vampire.lavielle.com [194.64.21.10]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id FAA02737 for ; Fri, 20 Nov 1998 05:00:17 -0800 (PST) Received: from [194.163.195.67] (pbg3.lavielle.com [194.64.21.18]) by vampire.lavielle.com (8.8.8/8.8.8) with ESMTP id OAA12739 for ; Fri, 20 Nov 1998 14:03:14 +0100 (MET) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Sender: joswig@194.64.21.10 Message-Id: In-Reply-To: <9811200432.ZM10009@goblin.cs.caltech.edu> Date: Fri, 20 Nov 1998 14:01:53 +0100 To: From: Rainer Joswig Subject: Re: Confused by #() in clisp At 4:18 Uhr -0800 20.11.1998, Jim Arvo wrote: >Lisp would complain, right? The problem is that it's trying to evaluate >the thing on the right. Even though it's a perfectly fine representation of >a list, this causes an error. Same with > >(setq a #(1 2 3 4)) > >The thing on the right is a perfectly fine representation of a "vector", >but SETQ is trying to *evaluate* it. You see, "#(" is a signal to the >Lisp *reader* that what follows are elements of a vector. By the time >SETQ sees it, it's already assembled, and SETQ tries to evaluate it. Error. >If you try typing in > >(setq a '#(1 2 3 4)) > >you'll see that it works. Your confusion probably stems for the similarity >with the notation #'foo, which is a shorthand for (function foo), which is >something that indeed needs to be *evaluated*! Hmm, some external representations can be read back. #(...) is such a thing. If you want to evaluate a vector, well, the result is the vector. It is a Self-Evaluating Object. See in the ANSI HyperSpec: 3.1.2.1.3.1 Examples of Self-Evaluating Objects So, (setq a #(1 2 3 4)) is perfectly legal in ANSI CL. Rainer Joswig, Lavielle EDV Systemberatung GmbH & Co, Lotharstrasse 2b, D22041 Hamburg, Tel: +49 40 658088, Fax: +49 40 65808-202, Email: joswig@lavielle.com , WWW: http://www.lavielle.com/~joswig/ From vassili@objectpeople.com Fri Nov 20 05:31:15 1998 Received: from www.objectpeople.com (mail.objectpeople.com [209.217.82.114]) by seagull.cdrom.com (8.8.8/8.6.6) with SMTP id FAA03254 for ; Fri, 20 Nov 1998 05:31:08 -0800 (PST) Received: from [209.217.82.118] by www.objectpeople.com (NTMail 3.03.0017/1.ahwq) with ESMTP id da377861 for ; Fri, 20 Nov 1998 08:32:41 +0000 Message-ID: <365570EE.1F76C164@objectpeople.com> Date: Fri, 20 Nov 1998 08:38:54 -0500 From: Vassili Bykov Organization: The Object People X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 To: clisp-list@seagull.cons.org Subject: Re: Confused by #() in clisp References: <9811201300.AA12585@magalhaes.isr.ist.utl.pt> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Rodrigo Ventura wrote: > What is going on? I guess it is necessary to distinguish > between the _reader_ and the _evaluator_. The reader reads numbers and > vectors ok, the question is what shall the evaluator do with them. At > page 70 of the CLtL2, Steele states: "All numbers, characters, > strings, and bit-vectors are self-evaluating forms.[...] The empty > list (), [...] is also a self-evaluating form. [...] Keywords ([...]) > also evaluate to themselves" This is very clear to me, although I > still do not understand why Steele does not mention arrays and vectors > in that list. Did he forgot them? 8-) This is why the Elders gave us the HyperSpec (section 3.1.2.1.3): <> > May I attempt an explanation? The list enumerated by Steele > comprises only "small" objects, or objects that need no memory > allocation, that can be stored in a machine word. Arrays, as well as > vectors, need memory allocation, and therefore require an explicit > quote. Maybe this is important to the compiler, to know how to deal > with constants and inline constants. But this explanation fall far > from the beauty of the abstract language. HyperSpec 3.2.4: <> (followed by a few sections defining the similarity). -- Vassili Bykov vassili@objectpeople.com The Object People http://www.objectpeople.com +1(613)225-8812 "Any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp." -- Greenspun's Tenth Rule of Programming From yoda@isr.isr.ist.utl.pt Fri Nov 20 06:21:33 1998 Received: from isr.isr.ist.utl.pt (isr.isr.ist.utl.pt [193.136.138.1]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id GAA03726 for ; Fri, 20 Nov 1998 06:21:28 -0800 (PST) Received: from magalhaes.isr.ist.utl.pt (magalhaes [193.136.138.9]) by isr.isr.ist.utl.pt (8.8.8/8.8.8) with SMTP id OAA21319 for ; Fri, 20 Nov 1998 14:23:27 +0100 (GMT+0100) Received: by magalhaes.isr.ist.utl.pt (5.65v3.2/1.1.10.5/12Dec97-1230PM) id AA13368; Fri, 20 Nov 1998 14:25:23 GMT Date: Fri, 20 Nov 1998 14:25:23 GMT Message-Id: <9811201425.AA13368@magalhaes.isr.ist.utl.pt> From: Rodrigo Ventura To: clisp-list@seagull.cons.org In-Reply-To: Vassili Bykov's message of Fri, 20 Nov 1998 05:32:04 -0800 (PST) Subject: Re: Confused by #() in clisp References: <365570EE.1F76C164@objectpeople.com> Mime-Version: 1.0 (generated by tm-edit 7.95) Content-Type: text/plain; charset=US-ASCII >>>>> "Vassili" == Vassili Bykov writes: Vassili> Rodrigo Ventura wrote: >> page 70 of the CLtL2, Steele states: "All numbers, characters, >> strings, and bit-vectors are self-evaluating forms.[...] The empty >> list (), [...] is also a self-evaluating form. [...] Keywords ([...]) >> also evaluate to themselves" This is very clear to me, although I >> still do not understand why Steele does not mention arrays and vectors >> in that list. Did he forgot them? 8-) Vassili> This is why the Elders gave us the HyperSpec (section 3.1.2.1.3): Vassili> < self-evaluating object. Evaluating such an object yields the same Vassili> object as a result. So we have a contradiction in hands, don'te we? Not quite: in the same page, it can be read: "X3J13 voted in October 1988 <72> to specify that all standard Common Lisp data objects other than symbols and lists (including defstruct structures defined without the :type option) are self-evaluating." This is very clear. You are _right_, CLISP should be corrected in this detail (I don't know how it works with the brand new CLISP version). CLISP's implementation notes say nothing about the CLtL2 section 5.1, which defines this issue. I wonder what Bruno thinks about this... Best Regards, -- -- *** Rodrigo Martins de Matos Ventura, alias *** yoda@isr.ist.utl.pt, http://www.isr.ist.utl.pt/~yoda *** Teaching Assistant and MSc. Student at ISR: *** Instituto de Sistemas e Robotica, Polo de Lisboa *** Instituto Superior Tecnico, Lisboa, Portugal *** PGP Public Key available on my homepage *** Key fingerprint = 0C 0A 25 58 46 CF 14 99 CF 9C AF 9E 10 02 BB 2A From sds@eaglets.com Fri Nov 20 06:36:20 1998 Received: from mail.eaglets.com ([208.235.77.228]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id GAA04036 for ; Fri, 20 Nov 1998 06:36:19 -0800 (PST) Received: by mail.eaglets.com from localhost (router,SLMail V3.1); Fri, 20 Nov 1998 09:37:01 -0500 Received: by mail.eaglets.com from eho.eaglets.com [208.235.77.238] (SLmail 3.1.2948 (Release Build)); Fri, 20 Nov 1998 09:37:01 -0500 Received: (from sds@localhost) by eho.eaglets.com (8.9.1/8.9.1) id JAA24008; Fri, 20 Nov 1998 09:37:35 -0500 To: clisp-list@seagull.cons.org Subject: Re: Confused by #() in clisp References: <19981120074955.F31527@hagbard.demon.co.uk> Return-Receipt-To: sds@goems.com Reply-To: sds@goems.com X-Disclaimer: You should not expect anyone to agree with me. X-Attribution: Sam X-No-Archive: Yes Mail-Copies-To: never From: Sam Steingold In-Reply-To: Dave Pearson's message of "Fri, 20 Nov 1998 00:13:45 -0800 (PST)" Date: 20 Nov 1998 09:37:34 -0500 Message-ID: Lines: 18 X-Mailer: Gnus v5.5/Emacs 20.3 Others answered in depth. My answer has the only advantage - brevity. >>>> In message <19981120074955.F31527@hagbard.demon.co.uk> >>>> On the subject of "Confused by #() in clisp" >>>> Sent on Fri, 20 Nov 1998 00:13:45 -0800 (PST) >>>> Honorable Dave Pearson writes: >> >> *** - EVAL: illegal form #(1 2 3 4) In ANSI CL #(...) is self-evaluating, but not in CLtL1. To get strict ANSI compliance, run clisp with "-a" command line switch. Then you will get (setq a #(1 2)) working. -- Sam Steingold (http://www.goems.com/~sds) running RedHat5.1 GNU/Linux Micros**t is not the answer. Micros**t is a question, and the answer is Linux, (http://www.linux.org) the choice of the GNU (http://www.gnu.org) generation. Two wrongs don't make a right, but three rights make a left. From haible@ilog.fr Fri Nov 20 07:35:17 1998 Received: from sceaux.ilog.fr (sceaux.ilog.fr [193.55.64.10]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id HAA04664 for ; Fri, 20 Nov 1998 07:35:10 -0800 (PST) Received: from ilog.ilog.fr ([172.17.4.22]) by sceaux.ilog.fr (8.9.1/8.9.1) with ESMTP id QAA14956 for ; Fri, 20 Nov 1998 16:36:40 +0100 (MET) Received: from jaures.ilog.fr (jaures.ilog.fr [172.16.1.81]) by ilog.ilog.fr (8.8.8/8.7.3) with ESMTP id QAA05990; Fri, 20 Nov 1998 16:36:35 +0100 (MET) From: Bruno Haible Received: (from haible@localhost) by jaures.ilog.fr (8.9.0/8.9.0) id QAA10367; Fri, 20 Nov 1998 16:36:36 +0100 (MET) Date: Fri, 20 Nov 1998 16:36:36 +0100 (MET) Message-Id: <199811201536.QAA10367@jaures.ilog.fr> To: clisp-list@seagull.cons.org Subject: Re: Confused by #() in clisp In-Reply-To: References: Sam Steingold writes: > In ANSI CL #(...) is self-evaluating, but not in CLtL1. Yes. > To get strict ANSI compliance, run clisp with "-a" command line switch. > Then you will get (setq a #(1 2)) working. The command line switch "-a" only exists in recent development snapshots. In released CLISP, you can achieve the same effect through the option -p CL-USER which puts you in package COMMON-LISP-USER, a package with better ANSI CL compliance than the default USER package. Bruno From davep@hagbard.demon.co.uk Fri Nov 20 07:38:59 1998 Received: from post.mail.demon.net (post-12.mail.demon.net [194.217.242.41]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id HAA04804 for ; Fri, 20 Nov 1998 07:38:57 -0800 (PST) Received: from [158.152.34.118] (helo=hagbard.demon.co.uk) by post.mail.demon.net with esmtp (Exim 2.053 #1) id 0zgsfl-0003bJ-00 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 15:40:37 +0000 Received: (from davep@localhost) by hagbard.demon.co.uk (8.8.3/v3.2) id OAA14794 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 14:42:34 GMT Message-ID: <19981120144233.M31527@hagbard.demon.co.uk> Date: Fri, 20 Nov 1998 14:42:33 +0000 From: Dave Pearson To: Multiple recipients of list Subject: Re: Confused by #() in clisp Mail-Followup-To: Multiple recipients of list References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1 In-Reply-To: ; from Rainer Joswig on Fri, Nov 20, 1998 at 05:00:38AM -0800 Organization: Hagbard's World X-URL: http://www.acemake.com/hagbard/ X-OS: Linux 2.0.33 i586 On Fri, Nov 20, 1998 at 05:00:38AM -0800, Rainer Joswig wrote: > So, (setq a #(1 2 3 4)) is perfectly legal in ANSI CL. [Sorry to carry this on] So does this mean that there is a "problem" with clisp in respect to the above? -- Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader. http://www.acemake.com/hagbard/ | eg - Norton Guide reader for Linux. http://www.hagbard.demon.co.uk/ | weg - Norton Guide reader for Windows. Free software, including........| dgscan - DGROUP scanner for Clipper. From davep@hagbard.demon.co.uk Fri Nov 20 07:38:59 1998 Received: from post.mail.demon.net (post-12.mail.demon.net [194.217.242.41]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id HAA04803 for ; Fri, 20 Nov 1998 07:38:55 -0800 (PST) Received: from [158.152.34.118] (helo=hagbard.demon.co.uk) by post.mail.demon.net with esmtp (Exim 2.053 #1) id 0zgsfo-0003bJ-00 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 15:40:40 +0000 Received: (from davep@localhost) by hagbard.demon.co.uk (8.8.3/v3.2) id OAA14719 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 14:39:47 GMT Message-ID: <19981120143946.L31527@hagbard.demon.co.uk> Date: Fri, 20 Nov 1998 14:39:46 +0000 From: Dave Pearson To: Multiple recipients of list Subject: Re: Confused by #() in clisp Mail-Followup-To: Multiple recipients of list References: <9811200432.ZM10009@goblin.cs.caltech.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1 In-Reply-To: <9811200432.ZM10009@goblin.cs.caltech.edu>; from Jim Arvo on Fri, Nov 20, 1998 at 04:18:32AM -0800 Organization: Hagbard's World X-URL: http://www.acemake.com/hagbard/ X-OS: Linux 2.0.33 i586 On Fri, Nov 20, 1998 at 04:18:32AM -0800, Jim Arvo wrote: > > > (setq a #(1 2 3 4)) > > > > *** - EVAL: illegal form #(1 2 3 4) > > 1. Break> > > Does this really work in ACL? It shouldn't! Sure does: USER(1): (setq foo #(1 2 3)) #(1 2 3) USER(2): (aref foo 0) 1 > Let me explain. What do you think would happen if you typed in (setq x (a > b c)) ? > > Lisp would complain, right? It would complain if (please excuse my terminology) no function was bound to the symbol A (and nothing was bound to the symbols B and C). Otherwise the result of (a b c) would be bound to x. However, I thought the use of # made this work a little different? > Your confusion probably stems for the similarity with the notation #'foo, > which is a shorthand for (function foo), which is something that indeed > needs to be *evaluated*! Perhaps. What further confuses me is that it does work in other lisps and also that in clisp you can do things like: > (setq foo #c(1 2)) #C(1 2) without the need to "escape" the #. I guess the point here is that it isn't a "problem" with clisp but is instead a problem with my understanding of reader macros? -- Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader. http://www.acemake.com/hagbard/ | eg - Norton Guide reader for Linux. http://www.hagbard.demon.co.uk/ | weg - Norton Guide reader for Windows. Free software, including........| dgscan - DGROUP scanner for Clipper. From davep@hagbard.demon.co.uk Fri Nov 20 08:48:48 1998 Received: from post.mail.demon.net (post-12.mail.demon.net [194.217.242.41]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id IAA05759 for ; Fri, 20 Nov 1998 08:48:47 -0800 (PST) Received: from [158.152.34.118] (helo=hagbard.demon.co.uk) by post.mail.demon.net with esmtp (Exim 2.053 #1) id 0zgtlN-0000Qe-00 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 16:50:29 +0000 Received: (from davep@localhost) by hagbard.demon.co.uk (8.8.3/v3.2) id PAA16490 for clisp-list@clisp.cons.org; Fri, 20 Nov 1998 15:44:44 GMT Message-ID: <19981120154444.N31527@hagbard.demon.co.uk> Date: Fri, 20 Nov 1998 15:44:44 +0000 From: Dave Pearson To: Multiple recipients of list Subject: Re: Confused by #() in clisp Mail-Followup-To: Multiple recipients of list References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.1 In-Reply-To: ; from Sam Steingold on Fri, Nov 20, 1998 at 06:36:51AM -0800 Organization: Hagbard's World X-URL: http://www.acemake.com/hagbard/ X-OS: Linux 2.0.33 i586 On Fri, Nov 20, 1998 at 06:36:51AM -0800, Sam Steingold wrote: > In ANSI CL #(...) is self-evaluating, but not in CLtL1. To get strict > ANSI compliance, run clisp with "-a" command line switch. Then you will > get (setq a #(1 2)) working. Is this a feature of some unannounced version? davep@hagbard:~$ clisp -a clisp: invalid command-line option, try `clisp --help' davep@hagbard:~$ clisp -q -x "(lisp-implementation-version)" "1998-09-09 (September 1998)" -- Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader. http://www.acemake.com/hagbard/ | eg - Norton Guide reader for Linux. http://www.hagbard.demon.co.uk/ | weg - Norton Guide reader for Windows. Free software, including........| dgscan - DGROUP scanner for Clipper. From unk6@rz.uni-karlsruhe.de Mon Nov 23 01:54:10 1998 Received: from nz15.rz.uni-karlsruhe.de (exim@nz15.rz.uni-karlsruhe.de [129.13.64.15]) by seagull.cdrom.com (8.8.8/8.6.6) with SMTP id BAA07792 for ; Mon, 23 Nov 1998 01:54:02 -0800 (PST) Received: from rz114s0.uni-karlsruhe.de (gilbert@isdn220-85.rz.uni-karlsruhe.de [129.13.220.85]) by nz15.rz.uni-karlsruhe.de with smtp id 0zhsii-0000kP-00; Mon, 23 Nov 1998 10:55:48 +0100 To: clisp-list@seagull.cons.org Subject: Re: fork References: <199811132124.PAA04681@palantir.cannonexpress.com> From: Gilbert Baumann Date: 23 Nov 1998 10:34:19 +0100 In-Reply-To: David Tillman's message of Fri, 13 Nov 1998 13:23:53 -0800 (PST) Lines: 31 X-Mailer: Gnus v5.2.25/XEmacs 19.14 Message-Id: David Tillman writes: > > I believe I have asked this before, but did not > get a satisfactory answer. > > Is there a way to fork in CLISP? > > Thanks, Dave. Could you elaborate, what you actually want to accomplish? Do you want a truly UNIX fork(), which creates a copy of a [unix] process? Or do you want something along the line of multi-threading? Multi-threading for CLISP is underway, but do not wait for something useful any time soon. If you need multi-threading for your Lisp application, I must unfortunately suggest competing implementations, which have multi-threading like ACL or perhaps CMUCL. Or do you want to spawn another unix-program from within CLISP? Well, here is the LISP:SHELL function your friend. Or do you want to accomplish something different? Gilbert. -- ;;; You know you have hacked Lisp too much, when you m-c-x in a C buffer. From unk6@rz.uni-karlsruhe.de Mon Nov 23 01:54:14 1998 Received: from nz15.rz.uni-karlsruhe.de (exim@nz15.rz.uni-karlsruhe.de [129.13.64.15]) by seagull.cdrom.com (8.8.8/8.6.6) with SMTP id BAA07791 for ; Mon, 23 Nov 1998 01:54:01 -0800 (PST) Received: from rz114s0.uni-karlsruhe.de (gilbert@isdn220-85.rz.uni-karlsruhe.de [129.13.220.85]) by nz15.rz.uni-karlsruhe.de with smtp id 0zhsil-0000kY-00; Mon, 23 Nov 1998 10:55:51 +0100 To: clisp-list@seagull.cons.org Subject: Re: Confused by #() in clisp References: <19981120143946.L31527@hagbard.demon.co.uk> From: Gilbert Baumann Date: 23 Nov 1998 10:23:23 +0100 In-Reply-To: Dave Pearson's message of Fri, 20 Nov 1998 07:39:22 -0800 (PST) Lines: 74 X-Mailer: Gnus v5.2.25/XEmacs 19.14 Message-Id: Dave Pearson writes: > On Fri, Nov 20, 1998 at 04:18:32AM -0800, Jim Arvo wrote: > > It would complain if (please excuse my terminology) no function was bound to > the symbol A (and nothing was bound to the symbols B and C). Otherwise the > result of (a b c) would be bound to x. However, I thought the use of # made > this work a little different? > > > Your confusion probably stems for the similarity with the notation #'foo, > > which is a shorthand for (function foo), which is something that indeed > > needs to be *evaluated*! Well, I personally see #'foo more as a constant than as something to be truly evaluated, which is perhaps not the true story. Actually (FUNCTION ..) is a shift in evaluation rules from evaluating values to evaluating (not! invoke) functions. > Perhaps. What further confuses me is that it does work in other lisps and > also that in clisp you can do things like: > > > (setq foo #c(1 2)) > #C(1 2) > > without the need to "escape" the #. I guess the point here is that it isn't > a "problem" with clisp but is instead a problem with my understanding of > reader macros? You seem to be a bit confused about external and internal representation. You do not escape the `#' by the quote character (') but the real object. The reader is separated from the interpreter or compiler. The reader simply turns the stream of characters it is faced to into some internal representation. There is syntax for a lot of different types of things (lists, symbol, numbers etc.) Amoung these are vectors ("#(...)") and complex numbers ("#c(..)"). The interpreter or compiler has absolutely no knowledge about the particular syntax involved. The code it trys to compile or evaluate must not even originate from parsing but could as well been constructed by another Lisp function. The interpreter has its rules how to evaluate some objects it is faced to. Symbols act like variables, lists stand for function invokation most of time, some object evaluate to itself (e.g. numbers). Then you have the quote thingie to prohibit actual evaluation of some object. The syntax (e.g '(a b) ) is yet only a convention the reader knowns about; internally it is e.g. (QUOTE (A B)), which is what the interpreter sees. Now, there are also some objects, which are neither self-evaluating nor have any other particular evaluation rule defined for them. E.g. vectors! You name it. So to have some expression, which evaluates to a vector, you have to quote it. When you type '#(a b) the reader turns it into (QUOTE #(A B)) -- A list of two elements, the first is the symbol QUOTE, the seconds is a vector. The interpreter sees QUOTE as the first element of a list and thinks "Ah, the user wants to quote something; Give him simply the second element of this list." You could quote anything and the interpreter simply returns it verbatim. Whether the need to quote vectors is a good thing, is something I do not care about. I got used to it. And if it works without quote in some implementation it is IHMO no excuse to leave it out, because of portability reasons -- You never know, which arcane implementation of CL you might want to get in touch with your code. Apologies, if this is a bit long, but I am too tired to express my ideas any shorter, since it is virtually late. Gilbert. -- ;;; You know you have hacked Lisp too much, when you m-c-x in a C buffer. From joswig@lavielle.com Mon Nov 23 02:29:13 1998 Received: from vampire.lavielle.com (vampire.lavielle.com [194.64.21.10]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id CAA08570 for ; Mon, 23 Nov 1998 02:29:12 -0800 (PST) Received: from [194.163.195.67] ([194.163.195.67]) by vampire.lavielle.com (8.8.8/8.8.8) with ESMTP id LAA26230; Mon, 23 Nov 1998 11:32:30 +0100 (MET) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Sender: joswig@194.64.21.10 Message-Id: In-Reply-To: Date: Mon, 23 Nov 1998 11:31:12 +0100 To: clisp-list@seagull.cons.org, Multiple recipients of list From: Rainer Joswig Subject: Re: Confused by #() in clisp Cc: Gilbert Baumann At 1:57 Uhr -0800 23.11.1998, Gilbert Baumann wrote: > Whether the need to quote vectors is a good thing, is something I do > not care about. I got used to it. And if it works without quote in > some implementation it is IHMO no excuse to leave it out, because of > portability reasons -- You never know, which arcane implementation > of CL you might want to get in touch with your code. This has been changed in ANSI CL. Rainer Joswig, Lavielle EDV Systemberatung GmbH & Co, Lotharstrasse 2b, D22041 Hamburg, Tel: +49 40 658088, Fax: +49 40 65808-202, Email: joswig@lavielle.com , WWW: http://www.lavielle.com/~joswig/ From unk6@rz.uni-karlsruhe.de Mon Nov 23 04:29:31 1998 Received: from nz15.rz.uni-karlsruhe.de (nz15.rz.uni-karlsruhe.de [129.13.64.15]) by seagull.cdrom.com (8.8.8/8.6.6) with SMTP id EAA09539 for ; Mon, 23 Nov 1998 04:29:27 -0800 (PST) Received: from rz114s0.uni-karlsruhe.de (gilbert@isdn220-114.rz.uni-karlsruhe.de [129.13.220.114]) by nz15.rz.uni-karlsruhe.de with smtp id 0zhv8q-0000C4-00; Mon, 23 Nov 1998 13:30:56 +0100 To: clisp-list@seagull.cons.org Subject: Re: Confused by #() in clisp References: From: Gilbert Baumann Date: 23 Nov 1998 13:25:55 +0100 In-Reply-To: Rainer Joswig's message of Mon, 23 Nov 1998 02:29:21 -0800 (PST) Lines: 26 X-Mailer: Gnus v5.2.25/XEmacs 19.14 Message-Id: Moin Moin, Rainer Joswig writes: > > At 1:57 Uhr -0800 23.11.1998, Gilbert Baumann wrote: > > > Whether the need to quote vectors is a good thing, is something I do > > not care about. I got used to it. And if it works without quote in > > some implementation it is IHMO no excuse to leave it out, because of > > portability reasons -- You never know, which arcane implementation > > of CL you might want to get in touch with your code. > > This has been changed in ANSI CL. Sure, but I was talking about portability across CL implementations; not every impl. is ANSI CL. It perhaps depends; if you say "Hey, I only code according to the ANSI CL standard" everything looks promising. If you want to keep a back door open to use some not so hot CL like say GCL, you learn to stay away from ANSI CL features not really needed. Gilbert. -- ;;; You know you have hacked Lisp too much, when you m-c-x in a C buffer. From dtillman@palantir.cannonexpress.com Mon Nov 23 08:14:27 1998 Received: from palantir.cannonexpress.com (dtillman@palantir.cannonexpress.com [208.136.255.65]) by seagull.cdrom.com (8.8.8/8.6.6) with ESMTP id IAA11462 for ; Mon, 23 Nov 1998 08:14:26 -0800 (PST) Received: (from dtillman@localhost) by palantir.cannonexpress.com (8.8.7/8.8.7) id KAA25768; Mon, 23 Nov 1998 10:16:35 -0600 Date: Mon, 23 Nov 1998 10:16:35 -0600 Message-Id: <199811231616.KAA25768@palantir.cannonexpress.com> From: David Tillman To: clisp-list@clisp.cons.org In-reply-to: (message from Gilbert Baumann on Mon, 23 Nov 1998 01:55:44 -0800 (PST)) Subject: Re: fork References: >>>>> Gilbert Baumann writes: > Could you elaborate, what you actually want to accomplish? This is for a webserver I am working on. I am aware of CL-HTTP and I am not trying to re-invent the wheel. > Do you want a truly UNIX fork(), which creates a copy of a > [unix] process? > Or do you want something along the line of multi-threading? Multi-threading would be much more desirable. I realize that this is not quite posible with CLISP at the moment. > Multi-threading for CLISP is underway, but do not wait for > something useful any time soon. If you need multi-threading for > your Lisp application, I must unfortunately suggest competing > implementations, which have multi-threading like ACL or perhaps > CMUCL. I am using CMUCL at the moment because it has an actual fork. I have a copy of ACL but cannot use it for this application because it will probably get used commercially. Perhaps I can purchase a copy later. > Or do you want to spawn another unix-program from within > CLISP? Well, here is the LISP:SHELL function your friend. > Or do you want to accomplish something different? I want to run multiple instances of the server to handle heavy loads. Threads would be great for this. As of now I simply specify in a config file how many servers to start and I have separated out CMUCL specific fork and inet stuff into separate modules so as to make it as portable as possible. I do the fork right before the accept and let the OS determine which process gets the connection. At first I tried doing the networking stuff in C and communicating with CLISP by way of pipes, but it was just too much of a kludge. It still works with CLISP, I just have to fake the results from the fork procedure. > -- ;;; You know you have hacked Lisp too much, when you m-c-x in > a C buffer. Yeah, or when you keep typing (exit) at the shell prompt... -- David Tillman | Sparrow Information Systems | Contract C, C++, and dtillman@sparrowsys.com | www.sparrowsys.com | PERL code for UNIX.