Skip to content

Instantly share code, notes, and snippets.

@shirok
Created April 28, 2016 18:08
Show Gist options
  • Save shirok/a844dd3a3e940118cddbc2101d52b026 to your computer and use it in GitHub Desktop.
Save shirok/a844dd3a3e940118cddbc2101d52b026 to your computer and use it in GitHub Desktop.
$ clisp
i i i i i i i ooooo o ooooooo ooooo ooooo
I I I I I I I 8 8 8 8 8 o 8 8
I \ `+' / I 8 8 8 8 8 8
\ `-+-' / 8 8 8 ooooo 8oooo
`-__|__-' 8 8 8 8 8
| 8 o 8 8 o 8 8
------+------ ooooo 8oooooo ooo8ooo ooooo 8
Welcome to GNU CLISP 2.49 (2010-07-07) <http://clisp.cons.org/>
Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2010
Type :h and hit Enter for context help.
[1]> (load "line-oriented.lisp")
;; Loading file line-oriented.lisp ...
;; Loaded file line-oriented.lisp
T
[2]> 10 LET A = 0
(10 LET A = 0)
[3]> 20 PRINT A
(20 PRINT A)
[4]> 30 LET A = A + 1
(30 LET A = A + 1)
[5]> 40 GOTO 20
(40 GOTO 20)
[6]>
(in-package :user)
(let ((orig-rt (copy-readtable nil)))
(dotimes (n 10)
(set-macro-character
(digit-char n)
(lambda (stream char)
(let ((*readtable* orig-rt))
(values (list 'quote
(read-from-string
(concatenate 'string "(" (string char)
(read-line stream) ")")))))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment