« first day (386 days earlier)      last day (1149 days later) » 

2:31 AM
dot is way too useful to spend on marginal cases of syntax. we've lived happily without infix lambdas for decades. i expect it will not make the final cut of shakti - but i could be wrong.
ktye - no, i wouldn't want to force a syntactic distinction between f and {..}. if f = {..} then f and {..} should be everywhere intersubstitutable.
 
 
5 hours later…
7:47 AM
@beagle3 i made the following suggestion:
"spacy verbs" add 1 thing and remove 4 from k

(space)(')(1 char) is parsed as a verb.
the name comes from "space-each".

think of % as a special case of '%

1) io verbs need no special case any more
'0 instead of 0:

2) extensions such `p@ are true verbs now, dyadic cases are possible
'p"1+2"

3) built-ins could be replaced by it (unlikely)

4) user extensions (c/k.lib) could add function pointers: 0-9 a-z A-Z
monadic/dyadic
1 2 'u+!10
 
 
5 hours later…
1:04 PM
rejoice. in 2020.03.27:
sym   `a`b`
 
1:26 PM
this wasn't defined in previous versions?
 
 
1 hour later…
2:26 PM
@ktye I like it. what are your ideas about monadic vs dyadic interpretation of spacy verbs?
@ktye I would say it's definitely more useful than "raise exception" (which is what it did in k4 iirc)
re:monadic/dyadic interpretation, I mean: how do you force monadic interpretation in ambiguous contexts? by a trailing : like standard k? or by forcing a new scope with paranthess?
 
2:51 PM
you can't force monadic interpretation. the only possibly negative consequence i can see is that you can't project verbs, as in e.g. f:+[2]. can you think of any others?
 
3:05 PM
@StevanApter I mean fg which parses as *[f;g] vs f *:g which parses as f[*g] (I think; iirc the space stops it from being an auto-assignment equiv to f:fg - can't test now). But also, why not just project as in f:+[2;] ? one more char and very explicit.
 
i think the only way to achieve the effect of primitive projection is by enclosing it in a lambda: {x+y}[2]. +[2;] is a class error in shakti.
ktye's "spacey verb" proposal can be generalized by adding the "transform" syntax category.

there are two transform functions: raise { and lower }. i call them "elevators", and their purpose is to raise or lower the syntax category of their operand.

elevators have higher type than adverbs, and they bind tightly to the right:

}/

turns / into a verb.

{}/

turns / the verb of / into an adverb.

{/

is a no-op, as is

}3

you can find a 2x2 parser for k with transforms here:

http://nsl.com/k/ski/p.k
 
3:40 PM
Would "spacey verbs" also allow for (easier) overloading of operators? e.g. "x/y" vs. " 'x/y"?
 
4:11 PM
they would be exactly the same as + - * ... If you want monadic and dyadic, you have to implement two functions. The parser does not care. In my implementation i have a 256 function pointer table: https://github.com/ktye/i/blob/master/k.w#L72
All primitives are in their ascii position. 0-127 dyadic, 128-255 monadic. Their are empty spots for all characters and numbers for extensions. x 'A y calls function 65 and 'Ax calls 65+128.
@coltim " 'x/y" would not overload /. it calls reduce with the user function 'x
 
@kyte but what would x/y do (if x was e.g. a list)?
 
@coltim this is independent on the spacy verb proposal. any overload could be implemented. I also thought about leaving that to the embedder (who extends the function table), but i don't know which space to use, there is not much left.
 
 
3 hours later…
7:37 PM
@StevanApter what does 2x2(parser) mean or where does it come from?
 
8:10 PM
@StevanApter i mean the term "2x2" why is it called that way? because of "binding table B is a two-dimensional dictionary" and "type table C is a two-dimension..." ?
 
 
3 hours later…
11:31 PM
@ktye exactly - parsing is achieved by repeatedly scanning adjacent pairs in the input string (or token list)
 

« first day (386 days earlier)      last day (1149 days later) »