Closed ghost closed 3 years ago
Is there a type which means all types?
Is there a type which means all types?
Yes, you can use a as a type definition. At present you can use:
...and you can also use unions, e.g. dict|null.
Keep in mind that you can use the set-type operator to set the type flag on a dictionary on whatever you want.
What are you looking for? I wouldn't like to include generics really... I would like to keep the language more dynamic, currently I don't see the need, but I may be wrong! What's your use case exactly?
(!) ./src/utils.min(145,9) [a]: Undefined symbol 'a'
./src/utils.min(145,9) in symbol: a
./src/utils.min(145,13) in symbol: apply
./src/utils.min(145,13) in symbol: =>
src\base.min(4,20) in symbol: call
src\base.min(4,20) in symbol: invoke
src\base.min(4,20) in symbol: *utils/toStr
What did you try to do exactly? a
can only be used within an operator signature quotation...
Code:
( symbol toStr
(a :element ==> string :result)
(
"$1" (a) => % @result
)
) ::
The body should be the following:
"$1" (element) => % @result
a
is the type, not the name of the captured symbol 😉
The body should be the following:
"$1" (element) => % @result
a
is the type, not the name of the captured symbol 😉
Yes, my faulting. 👍 a
is a type but i wrote wrongly. typographic error 😄
In operator defining, we initialize params with a default value and there is no generics.