syntax (ordered by approximate descending ease of typing):
a/b/c: infix, prefix, postfix/unattached (todo in many entries i wrote it prefix/infix/postfix)
- subtraction/unary negation, 'opposite' semantic prefix when applied to punctuation/boundary? infixify? note: also valid within identifiers = __set//; also mb custom operator prefix when combined with punctuation () parens// ; note: x( )x is parens parameterized by x ; eol (actually, EndOfParagraph; EOL can only be typed with a newline)// ' option type unwrap with args/option type wrap/option type unwrap ; also, quote labels ("'LABELA") NOTE: can make more general, about WRAPPERS rather than just error handling (see eg 'dire' library), where lone ' with no arguments is just a special case , (autoconstructor-contexting)separator/lazy/strict . same as prefix/.keyword eg "attribute access"; and maybe when before punctuation, 'fold'/when after punctuation, elementwise/map? infixify? / bind ie label -- tight binding -1, eg 0..4-- == 0..(4-1) (more useful: 0..x--); OR maybe comment-to-EOL == ;; comment to EOL '' ?string ,, implicitly put current group inside of a []; and also inside []:multidim separator/?/? .. path literals (can be indexed into to get reified links)/?/? OR range (eg 1..3 == [1 2]) // comment to EOL?; OR mb separator between guard and branch in switch statement and similar constructs ; arrow in data or logical context? or is that /?; Haskell '$', or do we use ',' for that? ! /strict? parallelize? anti-parallelize? get started now (eager evaluation)? unlifted? golang-style channel?/ assertion 'ensures' (mb that's '!:')? % division; also mb custom operator prefix when combined with punctuation, NOT implying associativity. Probably not: in/elem/member (Python's "in" = math's 'elem'), that's %% & logical and?/impurity, aliasing | addressof/; also mb custom operator prefix when combined with punctuation * multiply/list unpacking, like in python? infixify?/get multiple return arguments as a graph (or should that be postfix []?); syntactic sugar to imitate variadic functions (variable number of arguments) by enclosing the rest of the subexpression in []; also mb custom operator prefix when combined with punctuation, implying associativity _ dummy arg (in argspec) or anonymous autolambda autovariable/privacy (unexported)/? ; as an identifier prefix, 'private' + concat (and addition)/infixify?/? mb infix + is short for parameterized parens around a single element, eg e+x is short for e( x )e ; also mb custom operator prefix when combined with punctuation, mb implying associativity {} block (like parens, but doesnt autoclose, and also defines a scope; within non-code context, enters code context) : grouping bind? type annotation to EOL? range constructor (as in Octave)? slicing (as in Octave, Python, Go) " ?string < less than/?/?; also mb custom operator prefix when combined with punctuation; also mb <T> for generic types? > greater than/?/?; also mb custom operator prefix when combined with punctuation <> generic types? ? ?/metavariable?/? requires? hypothetical assertion (mb that's '?:')? ; as prefix in type annotations, mb 'option-ify' eg '?string' is like 'Maybe String' [] graph constructor; enters data context note: not in ISO 646, but is in T.61 | pipe? logical or? reverse direction of composition, eg x.f1.f2 / / / Haskell's '$' (later: no, we have , for that) ; also mb custom operator prefix when combined with punctuation note: not in ISO 646, but is in T.61 @ ?/view? node label eg node annotation of color 'name' eg Haskell-style at-binding?/? , forall? note: not in ISO 646, but is in T.61 # comment-to-EOL, at least on first few lines? or ##? | ?/default collapse? footnote defn|len/footnote use? view? reserved for DSLs? |strict note: not in ISO 646, but is in T.61 $ extension sigil prefix? ?/metaquote? /interpolate? metavariable? antiquote? note: not in ISO 646, but is in T.61 \ escape EOL or other character note: not in T.61 ` argspec? infixify? autocoerce not in T.61 ^ (eol?) annotation, general prefix for anything having to do with meta/node annotation (x^annotationType:annotation)? type annotation (loose binding; annotates thing to its left; but don't we already have capitalized AST annotations for that?)? /? note: not in T.61 ~ autocoerce? general prefix (or postfix?) for sorta, similar, exception to the rules (but not exception as in error handling), shortcut, special literals note: not in T.61, apparently hard to type !! 'programmer promises' (mb that's '!!:') %% Python's in/elem/member? probably not: python's interpolation operator, possibly with syntactic sugar for x % (a,b)?; also Hoon's evaluate-with-changes? && logical AND? ** exponentiation? __ as an identifier prefix: reserved for the language ___ as an identifier prefix: reserved for the language implementation ++ tight binding +1, eg 0..x++ == 0..(x+1) :: type annotation to EOG (end of group, eg EOL or close parens or close bracket) (would like a single char for this?), or separation grouping a b :: c d == (a b) (c d)? 'such that' separating a variable introduction from the rest (or is that accomplished by putting the variable introduction in backquotes?)? "" << >> type annotation? character meta, or use <<< >>> for that? ?? @@ forall? the other stuff @ is mb used for? note: not in ISO 646, but is in T.61 ## ?/comment-to-EOL? far footnote?/far footnote? note: not in ISO 646, but is in T.61 $$ anon fn helper? replace-with-changes/interpolation operator?/?/? note: not in ISO 646, but is in T.61 || pipeline? logical OR? note: not in ISO 646, but is in T.61 ^^ edge annotation? quote? """ HERE document/multiline string// ${} interpolation of arbitrary expressions (as opposed to single identifiers) ""[] autostringify array constructor -# lazy ^+ label? ^.^ reified edge/path literal? ... reified edge/path literal? <P P> ternary operators; P is a string of allowable punctuation; eg x<|y|>z (what is the privilaged 'default' x<y>z then? mb sign(y(x,z)? eg the 'spaceship operator' would be equal to x<->z? or maybe something metaprogrammy) <x> infixify <-> perl spaceship operator (binary operator: compare and return -1, 0, or 1)? <=> perl spaceship operator (binary operator: compare and return -1, 0, or 1)? := function definition ?( )? enters logic context ?- question/answer (Q ?- A means 'question Q answered by A') |- single turnstile (inference) |= double turnstile (entailment) <: subtype (mb; this is common use but conflicts with our use of ':' to mean type annotation) <. subtype (mb)? in/member/elem? <- subtype (mb) ?: hypothetical assertion !: assertion !!: 'programmer promises' assertion !<: 'decreasing' loop annotation !!<: 'programmer promises' 'decreasing' loop annotation ->: logical 'implies' operator ?>: pre-condition !>: post-condition !!>: 'programmer promises' post-condition ^mbnonterminating annotation that some loop might not terminate lowercase variable; cannot be string-matched by metaprogramming UPPERCASE label; or, annotation that is not also an identifier Capitalized language/DSL (macro) keyword? or Ruby-style keyword? or, annotation that is also an identifier x, x1, .. default variable names for anonymous functions (should this be _, _1, ..? yes, probably) X, X1, .. some sort of metaprogrammy variable names (ie these are treated as Capitalized, not UPPERCASE) potential alpha ids for some things you might think would be punctuation: div division (but mb %) pow exponentiation (but mb **) .+ append to list ([1 2] .+ 3 == [1 2 3] (should we also have a CONS, that preappends at location 0, or is APPEND enough? mb +. is cons, .+ is append?) BUT this would conflict with using prefix . as 'elementwise' (syntactic metaoperator for map) as in OCTAVE +- and -+: cons and append? but then postfix - isnt a generic 'marker'.. mb that's okay though, make you use a 'section' to mark punctuation, eg (+)- for a marked '+'. Should it be 0 +- [1 2] but [1 2] -+ 3, or should the list be on the left in both cases? 0 +- [1 2] but [1 2] -+ 3 is not totally irregular, the way to remember it is that in both cases, the left-to-right position of the elements is the same as they will be in the resulting list +, and ,+: cons and append? but then , is not lazy/strict |- list comprehension |/ list comprehension filter |> list comprehension reduce
infixify: mb:
&? or mb just those of them without other functions (we only need one at each precedence level after all, and we'd like to use eg & for something else) |
'such thats' in patterns (mb something like '?-' ?)
need syntax to turn 'for' (foreach), which is by default parallel, into sequential
similarrly, need notation for reduce when it is non-commutative or even non-associative (fully sequential), because by default reduce is parallel and unordered
See also the older version, [1], which has a bunch of things which are looking for syntax.
probably should reserve a prefix for metaprogrammable punctuation; how about ^
compiler directives
metadata directives
decorators
numeric range constructor (1..10, i..10, 1.5..3..(.1), etc)
mb a general sigil prefix to mean 'platform-x', eg platform function call, eg platform fork (eg if the 'platform' sigil were '$' and 'fork' were fork, then $fork)
do we want a separate sigil for type annotation, or is ^ enough?
todo: is there something that does Haskell's a b $ c d $ e f == a b (c d (e f))? (ps is that even how $ works in haskell?). If colons are doing grouping separation already, then perhaps ,, is open to could do this?
pipes: reverse composition, and stream pipe (should
be rev compose instead of OR and | could be OR?) |
quantifiers (note that they also need variable to bind, and should have the possibility of having something like the 'slash operator' attached for mutual independence)
implies? material implies? non-material implies? iff?
subset, superset
definition (as opposed to assignment, equivalence, or a provisionally true fact)
giving a situation/context/time argument to a fluent (time-dependent fact function eg datomic, situation calculus)
'therefore' (there dots in a triangle)
union, intersection, complement
+-
'is reducible to' (do we just use
- for this?) |
'equivalence class of'
open interval, closed interval
tuple
inner product
conjugate transpose
transpose
conjugate
conditional probabilities
derivative, integral
exists! (exactly one of)
matrix product
tensor product
composition (eg relational composition R;S)
transitive closure-like (eg ^* in regexps)
laziness/evaluation style
note: in earlier versions i looked at presence in ISO 646 and T.61 as one measurement of 'easy to type'. But [] is not in ISO 646 (but it is in T.61), and i think {} is not even in T.61. I think we can't really do without frequent [] and {}, and any programmer already has to get a keyword to work with these for other languages. So maybe i should start ignoring ISO 646 and T.61.
note: it seems that a common pattern is for the infix variant of something to mean one thing, and for the prefix/postfix variants to mean two things completely unrelated to the infix variant, but related to each other. Which suggests that we separate the above table into 2 (infix, and prefix/postfix).
---