Path: utzoo!utgpu!water!watmath!clyde!ima!necntc!encore!pierson From: pierson@encore.UUCP (Dan Pierson) Newsgroups: comp.lang.lisp Subject: Re: #< syntax Message-ID: <3439@encore.UUCP> Date: 5 Aug 88 19:57:53 GMT References: <3387@phoenix.Princeton.EDU> <24911@think.UUCP> <3394@phoenix.Princeton.EDU> Reply-To: pierson@encore.UUCP (Dan Pierson) Distribution: na Organization: Encore Computer Corp, Marlboro, MA Lines: 48 In article <3394@phoenix.Princeton.EDU> eliot@phoenix.Princeton.EDU (Eliot Handelman) writes: >The problem is reading a lambda expression, or treating it as a piece of >data, not what gets printed out when I type in a definition. In KCl, >for example, I can treat #'foo as a list. I haven't found out how to do >so in Lucid, which uses #< syntax, because lambda-bindings are treated >as objects of type procedure. There are two issues here: 1. Must interpreted functions be represented as lists beginning with the symbol LAMBDA (or NAMED-LAMBDA, or ...)? The incipient "official" answer is no. X3J13 has just voted to require that objects that are subtypes of FUNCTION not also be subtypes of LIST (among other types). This is part of a larger proposal to clean up the meaning of the type FUNCTION. 2. Should users and programs be able to access the source code of interpreted (and maybe compiled) functions? The answer is clearly yes. The X3J13 cleanup subcommittee is discussing a proposal to do this. Lucid supports such access with the function SOURCE-CODE as shown below. >The next example is from a lisp that uses #< syntax. > >> (defun dog () 'dog) >DOG > >> #'dog ># > >> (cdr #'dog) >>>Error: # should be of type LIST Alternatively: > (defun dog () 'dog) DOG > #'dog # > (cdr (source-code #'dog)) (DOG NIL (BLOCK DOG (QUOTE DOG))) -- In real life: Dan Pierson, Encore Computer Corporation, Research UUCP: {talcott,linus,necis,decvax,ihnp4}!encore!pierson Internet: pierson@multimax.arpa