much stdlib docs
This commit is contained in:
parent
b941df68e1
commit
ee39de01fd
9 changed files with 228 additions and 74 deletions
|
|
@ -22,7 +22,17 @@ import (
|
|||
"gitlab.com/whom/shs/log"
|
||||
)
|
||||
|
||||
func decl_func(input *ast.Token, vars ast.VarTable, funcs ast.FuncTable) *ast.Token {
|
||||
/* Takes 3 arguments: name, list of arg names, and logic form
|
||||
* DOES NOT EVALUATE THE LOGIC FORM
|
||||
* adds an anonymous function to the FuncTable under the name specified
|
||||
* anonymous function will expect the args declared in arg2 and expand them in arg3
|
||||
* Then evaluates and returns result of arg3. This constitutes a function call
|
||||
*
|
||||
* Example:
|
||||
* (func foo (x) (print x))
|
||||
* (foo 4) -> prints 4
|
||||
*/
|
||||
func DeclFunc(input *ast.Token, vars ast.VarTable, funcs ast.FuncTable) *ast.Token {
|
||||
name := input
|
||||
if name.Tag != ast.SYMBOL {
|
||||
log.Log(log.ERR,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue