Difference between revisions of "REFAL"
Jump to navigation
Jump to search
SwissChili (talk | contribs) (Add standard functions) |
SwissChili (talk | contribs) (Add refal book) |
||
Line 3: | Line 3: | ||
This Wiki holds documentation for my implementation of REFAL. More information about how/why I wrote it is available on my [https://swisschili.sh/a-refal-interpreter/ website]. The interpreter is written in C++ and available on [https://github.com/swissChili/REFAL Github]. | This Wiki holds documentation for my implementation of REFAL. More information about how/why I wrote it is available on my [https://swisschili.sh/a-refal-interpreter/ website]. The interpreter is written in C++ and available on [https://github.com/swissChili/REFAL Github]. | ||
== | == Learn REFAL == | ||
There are a few good resources on REFAL for beginners available online: | |||
* The REFAL book by Valentin F. Turchin (inventor of REFAL), in [http://refal.botik.ru/book/html/ English] and [http://refal.net/rf5_frm.htm Russian]. | |||
== Built-in Functions == | == Built-in Functions == |
Revision as of 21:08, 15 April 2022
REFAL (Wikipedia) is a functional programming language designed around the idea of pattern matching. It was designed by Valentin Turchin in 1966 and first implemented in 1968.
This Wiki holds documentation for my implementation of REFAL. More information about how/why I wrote it is available on my website. The interpreter is written in C++ and available on Github.
Learn REFAL
There are a few good resources on REFAL for beginners available online:
Built-in Functions
These functions are pre-loaded into REFAL and can be used at any time. They are not identical to standard REFAL-5 functions: some changes have been made for simplicity's sake.
Input & Output Functions
<Print e.Expr>
Prints the expression to standard output. Returnse.Expr
.<Prout e.Expr>
Prints the expression to standard output. Returns an empty expression.
Stack (variable) Manipulation Functions
<Br s.Name '=' e.Value>
Pushes the variables.Name
onto the stack with the valuee.Value
<Dg s.Name>
"Digs" (pops) the variables.Name
off the stack. Returns the value associated withs.Name
<Cp s.Name>
Copies the variables.Name
, returns value associated withs.Name
. Unlike<Dg>
this does not remove the variable from the stack.