sparist / Om

The Om programming language.
http://om-language.org
Other
167 stars 8 forks source link

Implement "number" data type #4

Open sparist opened 11 years ago

sparist commented 11 years ago

Implement a Number program type with the following qualities:

catb0t commented 4 years ago

how does this integrate with panmorphism? of couse {hello} is like a string, so what will {1} be? it's a program with an operator named 1, so what represents the numeric 1, or vice versa?

sparist commented 4 years ago

Sorry for the late reply. The idea with panmorphism is that the type resides with the operator, not the operand. So {1}, if passed to a operator that interprets operands as numbers, will be interpreted as the number 1. If passed to an operator that interprets operands as strings, will be interpreted as the string "1". The only way it would be interpreted as an operator called 1 would be if it were passed to an operator that treats operands as operators, or if it were dequoted.