Changeset 37169 in project


Ignore:
Timestamp:
01/30/19 22:29:23 (3 weeks ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [45.248.77.253]:

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/shen

    r37162 r37169  
    77=== Shen
    88
    9 Shen is a hosted language that comes with a macro system, prolog, optional type system based on sequent calculus and a YACC.
     9Shen is a hosted language that comes with a macro system, prolog, optional type system based on sequent calculus and a YACC. This egg comes with a standalone binary chicken-shen that provides a REPL and a shen library to embedded inside Scheme.
    1010
    1111=== Egg Author
     
    2424=== Chicken Shen Usage
    2525
     26Usage for the standalone binary for running a REPL or loading a file or string is here:
     27 
    2628<enscript highlight="bash">
    2729$ chicken-shen -h
     
    3638</enscript>
    3739
    38 === Embedded in Scheme
     40=== Calling Shen from Scheme
     41
     42Runs the REPL inside Chicken Scheme
     43
     44<procedure> (run-shen) </procedure>
     45
     46Reads and loads a shen file
     47
     48<procedure> (read-file FILE) </procedure>
     49
     50
     51<procedure> (read-from-string STRING) </procedure>
     52
     53Loads a string containing shen code
     54
     55
    3956<enscript highlight="lisp">
    4057 (import (prefix shen shen:))
     58 
     59 ;;; Load file example
     60 (shen:read-file "foo.shen")
     61
     62 ;;; Evaluate string
     63 (shen:read-from-string "(define foo 0 -> 1 1 -> 0)")
     64 (shen:read-from-string "(foo 0)") ;;; Should return 1
     65 
    4166</enscript>
    4267
Note: See TracChangeset for help on using the changeset viewer.