<+
<-
:=
8.18
top
← prev up next →

Scheme+ for RacketπŸ”— i

source code: https://github.com/damien-mattei/Scheme-PLUS-for-Racket

#readerSRFI-105 package: SRFI-105-for-Racket
This reader package provides the SRFI-105 Curly Infix reader/parser.

This package provides the Scheme+ language definitions.

Scheme+ is an extension of the syntax of the Scheme language.

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).

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.

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.

Scheme+ makes it easy the access and assignment for arrays,strings,hash tables,etc by allowing the classic square brackets [ ] of other languages.

1Scheme+ Installation and DepandenciesπŸ”— i

Scheme+ can be installed via the Racket Package system or downloaded from Github. 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.

2Scheme+ Syntax and ConventionsπŸ”— i

In general Scheme+ use the same convention for infix expression than SRFI-105 Curly Infix that is an infix expression is between curly parenthesis { }. But infix sub-expressions are allowed to be between normal parenthesis ( ). Infix or prefix is then autodetected.In case of ambiguities { } force infix mode.

#reader SRFI-105 (require Scheme+) {3 * 5 + 2} 17
#lang reader SRFI-105
(requireScheme+)
{3·5+2³}
23

In the following sections i will omit to rewrite the directives about lang or reader and the requirement in each example to keep the code and the web page compact.

3Scheme+ ReferenceπŸ”— i

3.1DeclarationsπŸ”— i

syntax

( declarename1name2...)

Declare new variables named name1,name2,....

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.

3.2DefinitionsπŸ”— i

syntax

{name <+value}

Define new variable name and assign value value.

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.

There is some alias of this:

syntax

{name value}

Note: a lot of operators of Scheme+ that works left to right exist in the opposite sense, i will not document them as it is obvious,example:

syntax

{value name}

3.3AssignmentsπŸ”— i

syntax

{name <-value}

Assign to the variable name the value value.

{x<-7}
x
7

There is some alias of this:

syntax

{name :=value}

{index:=index+1}

syntax

{name value}

{z1.13+1.765i}

Example:

{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]}

DOCUMENTATION TO BE CONTINUED...

Another documentation is hosted on Github:

Documentation of Scheme+ for Racket on Github pages

top
← prev up next →

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /