Open andychu opened 2 years ago
related
Similar to Wolfram m-expressions: https://en.wikipedia.org/wiki/M-expression
I also wonder if we want Func[Str, Str => Int, Int]
-- I think the grammar can handle that
Hm you can also makes slices.
For QTT[name: Str, age: Int]
Or does it need to be:
QTT['name': Str, 'age': Int]
?
Or
QTT[Col['name', Str], Col['age', Int]]
>>> Dict[int, int:int]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.6/typing.py", line 682, in inner
return func(*args, **kwds)
File "/usr/lib/python3.6/typing.py", line 1107, in __getitem__
params = tuple(_type_check(p, msg) for p in params)
File "/usr/lib/python3.6/typing.py", line 1107, in <genexpr>
params = tuple(_type_check(p, msg) for p in params)
File "/usr/lib/python3.6/typing.py", line 374, in _type_check
raise TypeError(msg + " Got %.100r." % (arg,))
TypeError: Parameters to generic types must be types. Got slice(<class 'int'>, <class 'int'>, None).
>>>
Useful in Hay, but also proc param signatures ?
Although I guess those can be arbitary expressions that are unevaluated
So they don't even need to be symbol values? Just expressions
Only needed on the RHS for Hay
Should behave something like Python
How to create it?
Or a builtin can create it:
Hay
Is
%foo
a Symbol or a string? It can be an auto-created symbolSymbol('foo')
Does
%foo == 'foo'
? Probably notBut
Dict == Dict
, yesIdentity is an interned strings? Plus children? Might relate to Hay tree as well
Restrict number of children like Python does?
Dict[int]
is invalid. Probably not? This can be done by the consumer of the structureHow to serialize it? As JSON lists? I guess that works.