Closed dfellis closed 1 month ago
The Windows machine decided to install updates (probably) and took itself out, while I accidentally screwed up my ssh access just before going on a long trip, so... I guess I will have to spot-check Windows every so often in a VM?
Alan v0.2 doesn't really need these functions for the optional and fallible types. You can just
Maybe(val)
to be equivalent tosome(val)
,Maybe{myType}(void)
to be equivalent tonone
(a bit more awkward, type inference should eventually supportMaybe(void)
fornone
),Fallible(val)
forok(val)
andFallible{myType}(errorVal)
forerr(errorVal)
(again, type inference may help here). And theMaybe
andFallible
"functions" could be bound to?
and!
postfix operators to turn that into justval?
,void?
(assuming inference works as desired),val!
, anderrorVal!
(again assuming inference works as desired) which is even shorter.At the same time, many languages have a different meaning for
some
, as an array method for determining if any of the elements of the array passes the provided check function. Alan since v0.1 includes ahas
function that accepts a value directly and returns true if that value is present in the array. This is like a shorthand for a check function that performs an equality check on the value, so I decided to expandhas
to also accept check functions, which therefore made it equivalent tosome
in those languages.Since this language is aimed at both crowds, completely eliminating these terms from the language may be initially confusing, but should hopefully be less confusing than having a known term with a different meaning.