mirror of
https://gitlab.com/vindarel/ciel.git
synced 2025-12-15 14:51:16 -08:00
doc script++
This commit is contained in:
parent
2ca812a9cc
commit
c0ee6f5921
2 changed files with 18 additions and 8 deletions
|
|
@ -100,7 +100,7 @@ Rules
|
|||
- [[#scripting][Scripting]]
|
||||
- [[#shell-repl][Shell REPL]]
|
||||
- [[#lisp-library][Lisp library]]
|
||||
- [[#core-image-use-ciel-your-current-developer-setup][Core image: use CIEL your current developer setup]]
|
||||
- [[#core-image-use-ciel-in-your-current-developer-setup][Core image: use CIEL in your current developer setup]]
|
||||
- [[#libraries][Libraries]]
|
||||
- [[#language-extensions][Language extensions]]
|
||||
- [[#final-words][Final words]]
|
||||
|
|
@ -337,7 +337,7 @@ You can also use =generic-ciel=, based on [[https://github.com/alex-gutev/generi
|
|||
generic-cl allows us to define our =+= or =equalp= methods for our
|
||||
own objects (and more).
|
||||
|
||||
** Core image: use CIEL your current developer setup
|
||||
** Core image: use CIEL in your current developer setup
|
||||
|
||||
You can enter the =CIEL-USER= package when you start your Lisp image
|
||||
from your editor.
|
||||
|
|
|
|||
|
|
@ -14,19 +14,24 @@ An example script:
|
|||
;; Start your script with this to access all CIEL goodies:
|
||||
(in-package :ciel-user)
|
||||
|
||||
;; We have access to the STR library:
|
||||
(print (str:join "-" (list "I" "am" "a" "lisper")))
|
||||
(defun hello (name)
|
||||
"Say hello."
|
||||
;; format! prints on standard output and flushes the streams.
|
||||
(format! t "Hello ~a!~&" name))
|
||||
|
||||
;; Access CLI args:
|
||||
(hello (second (uiop:command-line-arguments)))
|
||||
|
||||
;; We have access to the DICT notation for hash-tables:
|
||||
(print "testing dict:")
|
||||
(print (dict :a 1 :b 2))
|
||||
|
||||
;; format! prints on standard output and flushes the streams.
|
||||
(format! t "cmd?")
|
||||
|
||||
;; We can run shell commands:
|
||||
(cmd:cmd "ls")
|
||||
|
||||
;; Access environment variables:
|
||||
(hello (uiop:getenv "USER"))
|
||||
|
||||
(format! t "Let's define an alias to run shell commands with '!'. This gives: ")
|
||||
(defalias ! #'cmd:cmd)
|
||||
(! "pwd")
|
||||
|
|
@ -42,8 +47,12 @@ An example script:
|
|||
|
||||
Output:
|
||||
|
||||
|
||||
```
|
||||
"I-am-a-lisper"
|
||||
$ ciel myscript.lisp you
|
||||
=>
|
||||
|
||||
Hello you!
|
||||
"testing dict:"
|
||||
|
||||
(dict
|
||||
|
|
@ -53,6 +62,7 @@ Output:
|
|||
cmd? ABOUT.org ciel ciel-core
|
||||
bin docs src
|
||||
[…]
|
||||
Hello vindarel!
|
||||
Let's define an alias to run shell commands with '!'. This gives:
|
||||
/home/vindarel/projets/ciel
|
||||
ciel-user>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue