Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the ALSO keyword mean in MLISP?

Tags:

lisp

I've been looking over the source code for the early AI project Parry recently. It's tricky because the bulk of the code is written in MLISP, for which no working implementation still exists (that I know of). Instead, I've been using the language specification (MLISP Users' Manual and the earlier MLISP Technical Report).

One curiosity that I haven't been able to explain is the IF-THEN-ELSE-ALSO construct, e.g.:

IF !LAMBDANAME(B) THEN ERROR("NONLAMBDA INTO REACT2",B) ALSO RETURN NIL;

The documentation I have been able to find does not mention an ALSO clause for the IF statement, and I'm scratching my head a bit to understand what it's for.

One plausible suggestion I've seen is that it's used the way the finally clause is used for exception handling in Java, i.e. to run cleanup code no matter how the IF is terminated. On the other hand, that doesn't explain statements that appear never to raise exceptions, like:

IF REACTTO='QUIT THEN REACTTO:=NIL ALSO TRACE_MEM:='NOSPECIALANAPH;

Any ideas?

like image 467
Tim Pierce Avatar asked Feb 09 '15 21:02

Tim Pierce


1 Answers

IF e1 THEN a ALSO b ALSO c ELSE d ALSO e ALSO f

Is just

(COND (e1 a b c) (T d e f))

See MLISP from David Canfield Smith, 1970.

like image 56
Rainer Joswig Avatar answered Oct 20 '22 07:10

Rainer Joswig