🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.atari16
Article #415

Whoops...I forgot INIT.LSP

#415
From: franco
Date: Sun, 13 Apr 1986 00:33
74 lines
2940 bytes
Whoops - I forgot to insert INIT.LSP onto one of the three disks I am
copying for people.  It is so short and the number of people needing it
is so long that the only practical way to get it out is over the net.
Hopefully this will be the last such transmission.

The file below should be named INIT.LSP:

--------------------------cut here----------------------------
; get some more memory
(expand 1)

; some fake definitions for Common Lisp pseudo compatiblity
(setq first  car)
(setq second cadr)
(setq rest   cdr)

; some more cxr functions
(defun caddr (x) (car (cddr x)))
(defun cadddr (x) (cadr (cddr x)))

; (when test code...) - execute code when test is true
(defmacro when (test &rest code)
          `(cond (,test ,@code)))

; (unless test code...) - execute code unless test is true
(defmacro unless (test &rest code)
          `(cond ((not ,test) ,@code)))

; (makunbound sym) - make a symbol be unbound
(defun makunbound (sym) (setq sym '*unbound*) sym)

; (objectp expr) - object predicate
(defun objectp (x) (eq (type-of x) :OBJECT))

; (filep expr) - file predicate
(defun filep (x) (eq (type-of x) :FILE))

; (unintern sym) - remove a symbol from the oblist
(defun unintern (sym) (cond ((member sym *oblist*)
                             (setq *oblist* (delete sym *oblist*))
                             t)
                            (t nil)))

; (mapcan ...)
(defmacro mapcan (&rest args) `(apply #'nconc (mapcar ,@args)))

; (mapcon ...)
(defmacro mapcon (&rest args) `(apply #'nconc (maplist ,@args)))

; (save fun) - save a function definition to a file
(defmacro save (fun)
         `(let* ((fname (strcat (symbol-name ',fun) ".lsp"))
                 (fval ',fun)
                 (fp (openo fname)))
                (cond (fp (print (cons (if (eq (car fval) 'lambda)
                                           'defun
                                           'defmacro)
                                       (cons fun (cdr fval))) fp)
                          (close fp)
                          fname)
                      (t nil))))

; (debug) - enable debug breaks
(defun debug ()
       (setq *breakenable* t))

; (nodebug) - disable debug breaks
(defun nodebug ()
       (setq *breakenable* nil))

; initialize to enable breaks but no trace back
(setq *breakenable* t)
(setq *tracenable* nil)
Technical Details
Message-ID: <54600056@iuvax.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!iubugs!iuvax!franco

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: Notesfiles; site iuvax.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!iubugs!iuvax!franco
From: franco@iuvax.UUCP
Newsgroups: net.micro.atari16
Subject: Whoops...I forgot INIT.LSP
Message-ID: <54600056@iuvax.UUCP>
Date: Sat, 12-Apr-86 19:33:00 EST
Article-I.D.: iuvax.54600056
Posted: Sat Apr 12 19:33:00 1986
Date-Received: Sat, 19-Apr-86 04:28:08 EST
Lines: 74
Nf-ID: #N:iuvax:54600056:000:2332
Nf-From: iuvax!franco    Apr 12 19:33:00 1986