$ ls ~ -l . . . lrwxrwxrwx 1 necto users 14 Jul 22 12:22 ns -> /network/file/system/users/necto . . .
$ cd tmp && git clone git://ecls.git.sourceforge.net/gitroot/ecls/ecl && cd ecl
$ ./configure --prefix "~/ns/ecl/" --exec-prefix "~/ns/ecl/"
Switching to directory `build' to continue configuration. configure: error: expected an absolute directory name for --exec_prefix: ~/ns/ecl/
./configure --prefix "/home/necto/ns/ecl/" --exec-prefix "/home/necto/ns/ecl/"
$ mkdir ~/ns/ecl && make && make install
$ ~/ns/ecl/bin/ecl ECL (Embeddable Common-Lisp) 11.1.1 Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya Copyright (C) 1993 Giuseppe Attardi Copyright (C) 2000 Juan J. Garcia-Ripoll ECL is free software, and you are welcome to redistribute it under certain conditions; see file 'Copyright' for details. Type :h for Help. Top level. > (quit)
/home/necto/ns/ecl/bin/ecl: error while loading shared libraries: libecl.so.11.1: cannot open shared object file: No such file or directory
You can add / home / necto / ns / ecl / lib to LD_LIBRARY_PATH ($ export LD_LIBRARY_PATH = LD_LIBRARY_PATH: / home / necto / ns / ecl / lib).$~/ns/ecl/bin/ecl -load tst.lisp
#/bin/bash # should be included into your .bashrc # should be in .../ecl folder # defines two commands: # ecl - to run lisp interpreter in interactive mode [usage: ecl --help] # cl $file - to execute lisp source with +cmd-args+ bind to # list of commandline arguments path_to_ecl=$(dirname ${BASH_SOURCE[0]}) # Use the next line, if ecl can't find libecl.so export LD_LIBRARY_PATH="$path_to_ecl"/lib:$LD_LIBRARY_PATH alias ecl="$path_to_ecl"'/bin/ecl' function ecl-run { line="(progn (defconstant +cmd-args+ '(${@})) (defconstant +/cl+ \"$path_to_ecl\/\") (load \"$path_to_ecl/my/common.lisp\" :verbose nil) (load \"$1\") (quit))" ecl -eval "$line" } alias cl='ecl-run'
;;; common.lisp - aggregator of different tools ;;; being used in scripts ;; add standart lybrary path eg /home/necto/ns/ecl :: use it on such way (load (lib/ "my/common.lisp")) (defun lib/ (str) (if (find-symbol "+/CL+") (concatenate 'string +/cl+ str) str)) ;; Another function useful in everyday scripting: ;; determine is a symb given as argument (if (find-symbol "+CMD-ARGS+") (defun symbol-mentioned-in-params (symb) (find symb +cmd-args+))) ;; Use "verbose" or "talkative" to see debug info from ;; your script (defun verbose-enabled-p () (and (find-symbol "+CMD-ARGS+") (or (find 'talkative +cmd-args+) (find 'verbose +cmd-args+)))) ;; A output stream which you can enable by taking option "talkative" ;; to a script using it (defconstant extra-out (if (verbose-enabled-p) t (make-string-output-stream))) ;; Also if user doesn't want to view all it's loads, disable it: (setf *load-verbose* (verbose-enabled-p)) ;;...
source ~/ns/ecl/to-bashrc
(defun print-funcs () (process-every-file file (make-pathname :directory '(:relative) :name "*" :type "lisp") :input (for-every-appropriate-line file "defun ([^ ]+) \(([^)]*)\)" (funame args) (print-hello funame) (print args extra-out)))) (defun print-hello (name) (format t "~%Hello, ~a." name)) (print-funcs)
$ cl all-funs.lisp
Hello, print-funcs. Hello, print-hello.
$ cl all-funs.lisp talkative
Hello, print-funcs. Hello, print-hello. name
Source: https://habr.com/ru/post/124725/
All Articles