Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maclisp hello world #689

Merged
merged 5 commits into from Sep 27, 2020
Merged

Maclisp hello world #689

merged 5 commits into from Sep 27, 2020

Conversation

larsbrinkhoff
Copy link
Member

Short document on how to write a hello world program in Maclisp.

Maybe first interpreted, then all the way to a compiled application.

Debugging tips from @eswenson1:

  • load COMPLR
  • Type ^G
  • (load "liblsp;dbg fasl")
  • (debug t)
  • (maklap)

Then, assuming it does the same thing and you don't get a prompt and it won't compile anything:

  • type ^B (to force a breakpoint)
  • type (debug) (to enter the debugger)
  • look around (v will give a nice backtrace, e will evaluate expressions, u/d to move up/down stack, ? for help).

@larsbrinkhoff
Copy link
Member Author

Add info on LEDIT? (Maybe LISPT too, but it doesn't seem so useful at this point.)

@larsbrinkhoff
Copy link
Member Author

I wrote a hello world here: leachim6/hello-world#567

(comment) ;-*- Lisp -*-
(progn
  (defun hello-world ()
    (princ "Hello World!")
    (quit))
  (close (prog1 infile (inpush -1)))
  (sstatus feature noldmsg)
  (gctwa)
  (gc)
  (sstatus flush t)
  (suspend ":KILL " '(ts hello))
(hello-world))

@larsbrinkhoff
Copy link
Member Author

@netsettler suggests linking from http://maclisp.info to information about running ITS and Maclisp. We do not yet have any good introductory text for Maclisp.

@larsbrinkhoff
Copy link
Member Author

The maclisp.info link is now there. That's an additional reason to have a nice beginner friendly text.

@larsbrinkhoff
Copy link
Member Author

I suggest a hello world intro text with this code.

(defun hello ()
  (princ "Hello Maclisp!")
  (terpri)
  (quit))

And to dump out an executable program.

(comment)
(progn
  (close (prog1 infile (inpush -1)))
  (fasload hello)
  (gc)
  (purify 0 0 'bporg)
  (sstatus flush t)
  (suspend ":kill " '(ts hello))
  (hello))

Plus appropriate text to explain everything, of course.

I'm not sure about calling (sstatus toplevel something). I think the standard REPL can be retained for this simple example.

@larsbrinkhoff
Copy link
Member Author

I'm taking this opportunity to add a HELLO directory with examples for Lisp, Mudde, Midas, and CLU.

@larsbrinkhoff
Copy link
Member Author

My main intent here was to add a small hello world for Maclisp. I'll happily take suggestions for a more elaborate introductory text, if you have any. If not, it can be added another time.

@larsbrinkhoff larsbrinkhoff deleted the lars/hello-lisp branch September 27, 2020 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants