Chicken Shen

Check-in [dba3ef221a]
Login
Overview
Comment:Added shen code => k-lambda doc
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256:dba3ef221a29ff7962b6c061ec1fe6b467b98b76f3b30832e702f7188a089ecc
User & Date: david 2019-02-01 10:10:27
Context
2019-02-01
10:27
Changed occurance of 'wasp' -> 'chicken' Leaf check-in: 0fb787401c user: david tags: trunk
10:10
Added shen code => k-lambda doc check-in: dba3ef221a user: david tags: trunk
10:10
Added sequent tutorial in sequent.shen check-in: f2e10f71e5 user: david tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Added docs/shen-code-to-klambda.org.















































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
To compile Shen code to KLambda code the following function can be used:

(define shen-to-kl
  Code -> (shen.elim-def (shen.walk (function macroexpand) Code)))

Note:
    As of Shen 16 this works, but may not be the case in other versions.
    shen.elim-def is side-effectful if Code is a define expression,
    and the result of (ps <Name>) (where <Name> is the name of the
    function) will be overwritten with the resulting code (but the 
    definition of the function itself will not).

Example:

Shen 2010, copyright (C) 2010 Mark Tarver
released under the Shen license
www.shenlanguage.org, version 16
running under Scheme, implementation: chibi-scheme
port 0.9 ported by Bruno Deferrari


(0-) (define shen-to-kl
  Code -> (shen.elim-def (shen.walk (function macroexpand) Code)))
shen-to-kl

(1-) (ps shen-to-kl)
[defun shen-to-kl [V530] [shen.elim-def [shen.walk
 [lambda V529 [macroexpand V529]] V530]]]

(2-) (shen-to-kl [define shen-to-kl Code -> [shen.elim-def [shen.walk
 [function macroexpand] Code]]])
[defun shen-to-kl [V532] [shen.elim-def [shen.walk
 [lambda V531 [macroexpand V531]] V532]]]

(3-) (ps shen-to-kl)
[defun shen-to-kl [V532] [shen.elim-def [shen.walk
 [lambda V531 [macroexpand V531]] V532]]]