[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.lisp

Interlisp function definition format

Tom Fawcett

7/30/2015 2:53:00 PM

Hi. I'm dissecting an old Interlisp-D program that examines function definitions. I don't have access to a Xerox machine and I couldn't get the open-source Interlisp interpreter to work.

Could someone who has access to Interlisp do:
(defineq (foo (lambda (a b c) (+ a b c))))

and

(defineq (PT (NLAMBDA X (CONS (QUOTE PT) X)))

and then tell me exactly what the definition slots of FOO and PT contain?

Thanks!
-Tom
PS. I do have an old Interlisp manual but I couldn't find a definitive spec.
3 Answers

Barry Margolin

7/30/2015 3:51:00 PM

0

In article <4f093e1b-f22f-4aca-a8da-75d306a06154@googlegroups.com>,
Tom Fawcett <tom.fawcett@gmail.com> wrote:

> Hi. I'm dissecting an old Interlisp-D program that examines function
> definitions. I don't have access to a Xerox machine and I couldn't get the
> open-source Interlisp interpreter to work.
>
> Could someone who has access to Interlisp do:
> (defineq (foo (lambda (a b c) (+ a b c))))
>
> and
>
> (defineq (PT (NLAMBDA X (CONS (QUOTE PT) X)))
>
> and then tell me exactly what the definition slots of FOO and PT contain?
>
> Thanks!
> -Tom
> PS. I do have an old Interlisp manual but I couldn't find a definitive spec.

I did some googling, and apparently NLAMBDA creates a function whose
arguments aren't evaluated. And I expect that using a symbol in place of
the parameter list causes it to be bound to the list of arguments. So

(pt foo bar) => (pt foo bar)

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Blake McBride

8/3/2015 1:18:00 AM

0

blake@blake-sony ~/LISPF4.git $ ./lispf4 BASIC.IMG
Lisp F4 , latest update =
(83 8 22)
Space (cells smallnum bignums atoms) =
(89171 1073690323 2998 2419)
--- Reset
_(defineq (foo (lambda (a b c) (+ a b c))))
NIL

_(defineq (PT (NLAMBDA X (CONS (QUOTE PT) X))))
NIL

_(getd 'foo)
(LAMBDA (A B C) (+ A B C))

_(getd 'pt)
(NLAMBDA X (CONS 'PT X))

_


This was done on LISPF4. Did you have any trouble with that?

Blake McBride



On Thursday, July 30, 2015 at 9:53:33 AM UTC-5, Tom Fawcett wrote:
> Hi. I'm dissecting an old Interlisp-D program that examines function definitions. I don't have access to a Xerox machine and I couldn't get the open-source Interlisp interpreter to work.
>
> Could someone who has access to Interlisp do:
> (defineq (foo (lambda (a b c) (+ a b c))))
>
> and
>
> (defineq (PT (NLAMBDA X (CONS (QUOTE PT) X)))
>
> and then tell me exactly what the definition slots of FOO and PT contain?
>
> Thanks!
> -Tom
> PS. I do have an old Interlisp manual but I couldn't find a definitive spec.

Blake McBride

8/3/2015 1:35:00 AM

0

Perhaps this can help

_(defineq (fun1 (lambda (x) x)))
NIL

_(defineq (fun2 (nlambda (x) x)))
NIL

_(setq v 55)
55

_(fun1 v)
55

_(fun2 v)
V




On Thursday, July 30, 2015 at 9:53:33 AM UTC-5, Tom Fawcett wrote:
> Hi. I'm dissecting an old Interlisp-D program that examines function definitions. I don't have access to a Xerox machine and I couldn't get the open-source Interlisp interpreter to work.
>
> Could someone who has access to Interlisp do:
> (defineq (foo (lambda (a b c) (+ a b c))))
>
> and
>
> (defineq (PT (NLAMBDA X (CONS (QUOTE PT) X)))
>
> and then tell me exactly what the definition slots of FOO and PT contain?
>
> Thanks!
> -Tom
> PS. I do have an old Interlisp manual but I couldn't find a definitive spec.