Re:An Opinionated Treatise on Cosmos, a New Programming Lang...
by DaFranker on Wednesday November 19, 2014 @07:57AM
(#8629704)
Because then what if:
Actually, I'd like to know what Cosmos would resolve this to as things stand. Is it just going to decide that | x = 0, | x = 2? Also can I throw probabilities into this code?
[ Parent
| on HN ]
Re:An Opinionated Treatise on Cosmos, a New Programming Lang...
by mccosmos on Wednesday November 19, 2014 @01:53PM
(#8631832)
One property of Cosmos is that there is no boolean type and relations are themselves booleans (q() would be false in this case). Hence, the code would be rather like this:
rel q()
true
false
...
rel main()
if(q())
...
Indeed, having an 'else' that negates the condition would get tough for complicated conditions. Negation-by-failure and soft-cut ('choose') have their own problems in certain circumstances.Yeah, it's going to decide that | x = 0 | x = 2 (there is no CLP for strings).