using_ecl_embeddable_common-lisp_on_sdf
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
using_ecl_embeddable_common-lisp_on_sdf [2021/03/11 05:20] – created hc9 | using_ecl_embeddable_common-lisp_on_sdf [2021/03/11 05:33] – [ECL one-liners] hc9 | ||
---|---|---|---|
Line 15: | Line 15: | ||
By default ECL starts up in interactive mode. Log into SDF host //miku// and type "' | By default ECL starts up in interactive mode. Log into SDF host //miku// and type "' | ||
- | | + | < |
- | Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya | + | |
- | Copyright (C) 1993 Giuseppe Attardi | + | ECL (Embeddable Common-Lisp) 11.1.1 |
- | Copyright (C) 2000 Juan J. Garcia-Ripoll | + | Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya |
- | ECL is free software, and you are welcome to redistribute it | + | Copyright (C) 1993 Giuseppe Attardi |
- | under certain conditions; see file ' | + | Copyright (C) 2000 Juan J. Garcia-Ripoll |
- | Type :h for Help. | + | ECL is free software, and you are welcome to redistribute it |
- | Top level. | + | under certain conditions; see file ' |
- | > | + | Type :h for Help. |
+ | Top level. | ||
+ | > | ||
+ | |||
+ | </code> | ||
The default ECL prompt is ">" | The default ECL prompt is ">" | ||
- | | + | < |
- | 6 | + | |
+ | > (+ 1 2 3) | ||
+ | 6 | ||
+ | |||
+ | > (* 4 5) | ||
+ | 20 | ||
- | | + | > (format t "hello SDF~& |
- | 20 | + | hello SDF |
+ | NIL | ||
+ | > | ||
- | > (format t "hello SDF~& | + | </code> |
- | hello SDF | + | |
- | NIL | + | |
- | | + | |
In-line help is available ; type :h for options. The debugger can be entered using " | In-line help is available ; type :h for options. The debugger can be entered using " | ||
Line 46: | Line 54: | ||
ex: hello.lsp | ex: hello.lsp | ||
- | % echo ' | + | <code> |
- | | + | % echo ' |
- | Hello SDF | + | |
+ | % ecl -norc -script hello.lsp | ||
+ | Hello SDF | ||
+ | |||
+ | </ | ||
It's also possible to use ECL to execute simple Common-Lisp one-liners at the command line (note that //princ// is needed for screen output): | It's also possible to use ECL to execute simple Common-Lisp one-liners at the command line (note that //princ// is needed for screen output): | ||
- | | + | < |
- | 6 | + | |
+ | % ecl -norc -shell /dev/null -eval " | ||
+ | 6 | ||
+ | |||
+ | </ | ||
A nicer way to accomplish the same is to create a small shell script: | A nicer way to accomplish the same is to create a small shell script: | ||
- | #!/bin/sh | + | < |
- | # lispit - executes a lisp expression and dumps it to stdout | + | |
- | LSP_EXPR=${@} | + | #!/bin/sh |
+ | # lispit - executes a lisp expression and dumps it to stdout | ||
- | if [ "$#" -eq 0 ]; then | + | LSP_EXPR=${@} |
- | echo " | + | |
- | echo " | + | |
- | echo "" | + | |
- | exit 1 | + | |
- | fi | + | |
- | | + | if [ " |
- | echo "" | + | echo " |
- | exit 0 | + | echo " |
+ | echo "" | ||
+ | exit 1 | ||
+ | fi | ||
+ | |||
+ | ecl -norc -shell /dev/null -eval " | ||
+ | echo "" | ||
+ | exit 0 | ||
+ | |||
+ | </ | ||
Example run: | Example run: | ||
- | | + | < |
- | (1 4 9 16 25) | + | |
+ | % lispit ' | ||
+ | (1 4 9 16 25) | ||
+ | |||
+ | </ | ||
===== ASDF / enabling readline ===== | ===== ASDF / enabling readline ===== | ||
Line 90: | Line 114: | ||
2) Create the ASDF config directory and config file*: | 2) Create the ASDF config directory and config file*: | ||
+ | |||
+ | < | ||
% cd $HOME | % cd $HOME | ||
Line 98: | Line 124: | ||
;; | ;; | ||
(:directory "/ | (:directory "/ | ||
+ | |||
+ | </ | ||
*note: you can call the conf file anything you want. | *note: you can call the conf file anything you want. | ||
Line 121: | Line 149: | ||
Additional modifications can be made to the ECL startup file, such as user-defined functions and tweaks to various modules. Below is a more nuanced example which reduces the verbosity at startup, modifies ecl-readline' | Additional modifications can be made to the ECL startup file, such as user-defined functions and tweaks to various modules. Below is a more nuanced example which reduces the verbosity at startup, modifies ecl-readline' | ||
+ | |||
+ | < | ||
# $HOME/ | # $HOME/ | ||
Line 137: | Line 167: | ||
User sub-shell is spawned. SHELL_CMD be string or symbol, 256 characters max." | User sub-shell is spawned. SHELL_CMD be string or symbol, 256 characters max." | ||
| | ||
+ | |||
+ | </ | ||
===== References: ===== | ===== References: ===== |
using_ecl_embeddable_common-lisp_on_sdf.txt · Last modified: 2021/03/12 18:34 by hc9