|
1 | 1 | #lang scribble/manual
|
2 | 2 |
|
3 |
| -@title{Scheme+ for Racket} |
4 |
| - |
| 3 | + |
| 4 | +@title[#:style '(toc)]{Scheme+ for Racket} |
| 5 | + |
| 6 | +@author[(author+email "Damien Mattei" "[email protected]")] |
| 7 | + |
| 8 | +source code: @url["https://github.com/damien-mattei/Scheme-PLUS-for-Racket"] |
| 9 | + |
| 10 | + |
| 11 | +@defmodule[SRFI-105 #:reader]{ |
| 12 | +This reader package provides the SRFI-105 Curly Infix reader/parser. |
| 13 | +} |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | +@defmodule[Scheme+]{ |
| 18 | +This package provides the Scheme+ language definitions. |
| 19 | +} |
| 20 | + |
| 21 | + |
| 22 | +Scheme+ is an extension of the syntax of the Scheme language. |
| 23 | + |
| 24 | +Scheme+ adds to Scheme a way to use also infix notation with a compatibility near 100% and not as a sub-system of Lisp syntax as it is often done but with a complete integration in the Scheme reader/parser system and also for Racket at REPL (Read Eval Print Loop). |
| 25 | + |
| 26 | +Scheme+ is to Scheme what a concept-car is to automobile.Scheme+ is a concept-language.It is ideally what should be a modern Scheme. |
| 27 | + |
| 28 | +Scheme+ makes it easy the assignment of Scheme objects in infix (works also in prefix) notation with a few new operators <- (or: ← , :=),⥆ (or <+) for definitions. |
| 29 | + |
| 30 | +Scheme+ makes it easy the access and assignment for arrays,strings,hash tables,etc by allowing the classic square brackets [ ] of others languages. |
| 31 | + |
| 32 | + |
| 33 | +@table-of-contents[] |
| 34 | + |
| 35 | + |
| 36 | +@section[#:tag "installation"]{Scheme+ Installation and Depandencies} |
| 37 | + |
| 38 | +Scheme+ can be installed via the Racket Package system or downloaded from Github. |
| 39 | +Scheme+ is designed to be used with the package SRFI-105 for Racket which is a curly infix reader also available in the same way described above. |
| 40 | + |
| 41 | +@section[#:tag "syntax"]{Scheme+ Syntax and Conventions} |
| 42 | + |
| 43 | +In general Scheme+ use the same convention for infix expression than SRFI-105 Curly Infix that is an infix expression is between curly parenthesis { }. |
| 44 | +But infix sub-expressions are allowed to be between normal parenthesis ( ). Infix or prefix is then autodetected,in cas of ambiguities { } force infix mode. |
| 45 | + |
| 46 | +@codeblock|{ |
| 47 | +#reader SRFI-105 |
| 48 | +(require Scheme+) |
| 49 | +{3 * 5 + 2} |
| 50 | +17 |
| 51 | +}| |
| 52 | + |
| 53 | + |
| 54 | +@codeblock|{ |
| 55 | +#lang reader SRFI-105 |
| 56 | +(require Scheme+) |
| 57 | +{3 · 5 + 2 ³} |
| 58 | +23 |
| 59 | +}| |
| 60 | + |
| 61 | + |
| 62 | +@section[#:tag "reference"]{Scheme+ Reference} |
| 63 | + |
| 64 | + |
| 65 | +@subsection[#:tag "declarations"]{Declarations} |
| 66 | + |
| 67 | +@defform[(declare name1 name2 ...)]{ |
| 68 | +Declare new variables named @racket[name1],@racket[name2],.... |
| 69 | +} |
| 70 | + |
| 71 | +Note: this is rarely used,instead assignment macros are used but could be usefull in case a variable used in a block must be used outside too. |
| 72 | + |
| 73 | +@subsection[#:tag "definitions"]{Definitions} |
| 74 | + |
| 75 | +@defthing[⥆ macro]{} |
| 76 | + |
| 77 | +@defform[{name <+ value}]{ |
| 78 | +Define new variable @racket[name] and assign value @racket[value]. |
| 79 | +} |
| 80 | + |
| 81 | +Note: this is almost never used in Racket,because Scheme+ for Racket as a special feature of autodetection if a variable needs to be defined before assignment. |
| 82 | + |
| 83 | +There is some alias of this: |
| 84 | + |
| 85 | +@defform[{name ⥆ value}]{} |
| 86 | + |
| 87 | +Note: a lot of operators of Scheme+ that works left to right exist in the opposite sense, i will document them as it is obvious,example: |
| 88 | + |
| 89 | +@defform[{value ⥅ name}]{} |
| 90 | + |
| 91 | +@subsection[#:tag "assignment"]{Assignments} |
| 92 | + |
| 93 | +@defthing[← macro]{} |
| 94 | + |
| 95 | +@defform[{name <- value}]{ |
| 96 | +Assign to the variable @racket[name] the value @racket[value]. |
| 97 | +} |
| 98 | + |
| 99 | +@codeblock|{ |
| 100 | +#lang reader SRFI-105 |
| 101 | +(require Scheme+) |
| 102 | +{x <- 7} |
| 103 | +}| |
| 104 | + |
| 105 | +There is some alias of this: |
| 106 | + |
| 107 | +@defform[{name := value}]{} |
| 108 | + |
| 109 | + |
| 110 | +@defform[{name ← value}]{} |
| 111 | + |
| 112 | +@codeblock{ |
| 113 | +{M_i_o[j {i + 1}] <- M_i_o[j {i + 1}] + η · z_input[i] · მzⳆმz̃(z_output[j] z̃_output[j]) · ᐁ_i_o[j]} |
| 114 | +} |
| 115 | + |
| 116 | + |
5 | 117 | The documentation is hosted on Github:
|
6 | 118 |
|
7 | 119 | @hyperlink["https://github.com/damien-mattei/Scheme-PLUS-for-Racket/blob/gh-pages/README.md"]{Documentation of Scheme+ for Racket on Github pages}
|
0 commit comments