() grouping [] data (arc labels are quoted but values are evaluated) ?[ ] quoted graph (values are not yet evaluated) [?? ] implicitly quote arc values (like adding a ? before each value) [' ] arc labels are implicitly literal strings [ ] arc labels and values are implicitly literal strings colon-separated (default is space-separated)
the variant args can be combined. note that these are considered environment openers, producing a single environment opening token, and so if a newline follows immediately afterwards, multiline mode is not triggered as this is considered an environment opener at the end of the line.
[a b ; c d] 2d matrix; equiv to [\na b \n c d] [a b ; c d ;; e f ; g h] 3d matrix; equiv to [\na b \n c d \n;;\n e f ; g h]
anything starting with <, >,
, or = |
/ ',', ',,', ',,,', etc .
! strict / evaluate now
"" string string (what's the difference?) _ free placeholder (can be used to index matrixes like Python's ':') _1, _2, _3.. argument n
(= anonymous fn defn x= (attached on left side) in-placify; use _ for the target arg, or first arg if omitted
:= move (unique assignment; copy and delete)
A (single letter caps): reserved constant/keyword MULTILETTERCAPS local label Capitalized meaningful label (e.g. for metaprogramming)
Lazy stop recursive strictification here
? quote/don't evaluate $ insert value here (string interpolation, in-place graph expansion)
what is map?
~ something to do with exception handling @ perspective
need something for repr (mb not, ;; is good enuf), something for Python's %
-^LABEL continuation at LABEL exec continuation value execute continuation exec -^LABEL value execute continuation at LABEL
.~ like ., but a.~b returns nil is a is nil.
% named return argument (last (lexically) bound)
guard |
' surround following word with ""s? map? exception handling? any/all?
" raw string quotations. no escaping, interpolation, not even \"! e" string quotations with limited escaping. no escaping, interpolation, except for \". ee" string quotations with escaping, interpolation. x" raw string quotations using x instead of ". if x begins with an env opener, string is ended by the closer, and you can nest. x cannot be 'e'. xe" string quotations using x instead of ", with limited escaping. xee" string quotations using x instead of ", with escaping and interpolation. "", e"", ee"" HERE doc (goes until "" is first after a newline) blah"", blahe"", blahee"" HERE doc (goes until blah is first after a newline) """ docstring
named function construction: single return arg: fnname = var1 var2 optionalArg=default = function_definition multiple return args: fnname = [return_1 return_2] = var1 var2 optionalArg=default = function_definition
named function with multiple entry points: single return arg: (fnname1 = var1 var2 optionalArg=default) and (fnname2 = var1 var2 optionalArg=default) = function_definition multiple return args: (fnname1 = [return_1 return_2] = var1 var2 optionalArg=default) and (fnname2 = [return_1 return_2] = var1 var2 optionalArg=default) = function_definition
guarded named function construction: replace var1 var2 optionalArg=default with var1 var2 optionalArg=default
x = var1 + var2 : y = var1 - var2 : x + y > 3 |
e.g.
( fnname1 = [return_1 return_2] = var1 var2 optionalArg=default | x = var1 + var2 y = var1 - var2 x + y > 3 ) and ((fnname2 = [return_1 return_2] = var1 var2 optionalArg=default) = function_definition
hmm.. or mb:
(= [return_vars] = 'fnname' [vars]
[conditions] and [return_vars2] = 'fnname2' [vars2] = body) |
anonymous function construction: single return arg, implicit args: (= function_definition) [var1 var2 optionalArg=default] is optional; can just use _1 _2 etc in the value; highest _n will determine # of req'd args
single return arg: (= [var1 var2 optionalArg=default] = function_definition) multiple return args: (= [return_1 return_2] = var1 var2 optionalArg=default = function_definition)
exec if
T F Z like Octave's 'end' N nil NN 'nilish' values -- Falsish things are F, nil (and anything that isa nil), empty strings, zero, empty graphs (things which have an __nonnilish defined, and for which the result is True) -NN non-nilish values FUNCTION a label attached to the nearest function scope, going up CALLINGFUNCTION a label attached to the scope of the calling function me something to do with objects and scope NOT-FOUND NOT-FOUND isa N
(currently using as guard but could change that) |
any, all assertions decorators
"get the target of all the arcs with this label from this node and apply this function to each of them (map the fn over that set)"
cons/prepend (shall we just use ++? )
also need arc cons, tuple cons (can we just use -dict() and then cons? after all -dict() has an inverse)
symbols?
boxed/unboxed?
inplaceify
could have a character as a "mode prefix", allowing things like "any" and "all" to be marked. mb #? use ## for len.
%varname -> $varname (and if you want to insert the contents of the var into the current statement, you must use eval, e.g. eval(interpolate(statement)). this would free up %varnames. But it would not allow us to use $list for expand-in-place, which seems more useful. Mb $'varname? naw.
distinguish b/t left and right, and use 'condition'f to mean map and filter f, and f' to mean f with ALL? use &x for addr of x, and x& for derefererence x?
swap @ and ' ? ' is easier to type.
make ' be string quote word, or symbol, because obj."method" is too cumbersome. then need to change @ back to perspectives and find something else for list comprehensions.
if you want to make the lhs of a keyword argument via a variable, you must use () or $:
f $keyword=value f (keyword)=value