scml  Check-in [bc95a35c86]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:fdhjkashflksdh docs dfhjkadsklf
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bc95a35c8689a54929ab85423261efb5b8a106633e80a5dcb58fb301921750ed
User & Date: lexi 2019-05-25 06:56:45
Context
2019-05-25
06:57
jfjkakljahdjhkjh Leaf check-in: 32b0e979b1 user: lexi tags: trunk
06:56
fdhjkashflksdh docs dfhjkadsklf check-in: bc95a35c86 user: lexi tags: trunk
06:53
fix NEOVIM'S MISTAKES check-in: 041b160fa2 user: lexi tags: trunk
Changes

Changes to README.md.

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
### embedding scheme
there are three special forms that allow us to embed scheme code that is evaluated when the scml is translated to html. the simplest form is `(% …)` which will execute arbitrary scheme code. this code can mutate the execution environment, but its output will be ignored. a good use for this form is to define functions or globals

    (% (define page-title "index")
       (define path '(root list index))
       (define (emit-form target prompt)
              `((form (action . ,target) (method . "POST"))
                (div prompt "? " (- input (type . "text")
                                          (name . "field"))
                                 (- input (type . "submit"))))))

the next form, `(@ …)` is designed to make it as easy as possibly to use scheme functions from within the template body. simply write a normal scheme function call but with the atom `@` preceding the function name to dump its result into the page. the following example uses the defined functions to succinctly generate multiple simple forms. (note that `(% …)` can be implemented in terms of `(@ …)` as `(@ begin … '())`)

    (- !doctype html)
    (html (head (title "form example"))







|







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
### embedding scheme
there are three special forms that allow us to embed scheme code that is evaluated when the scml is translated to html. the simplest form is `(% …)` which will execute arbitrary scheme code. this code can mutate the execution environment, but its output will be ignored. a good use for this form is to define functions or globals

    (% (define page-title "index")
       (define path '(root list index))
       (define (emit-form target prompt)
              `((form (action . ,target) (method . "POST"))
                (div ,prompt "? " (- input (type . "text")
                                          (name . "field"))
                                 (- input (type . "submit"))))))

the next form, `(@ …)` is designed to make it as easy as possibly to use scheme functions from within the template body. simply write a normal scheme function call but with the atom `@` preceding the function name to dump its result into the page. the following example uses the defined functions to succinctly generate multiple simple forms. (note that `(% …)` can be implemented in terms of `(@ …)` as `(@ begin … '())`)

    (- !doctype html)
    (html (head (title "form example"))