Re:Pony – High Performance Actor Programming
by ShaneWilton on Sunday May 03, 2015 @08:14PM
(#9483641)
It's also worth noting that the language does have a None primitive, but the distinction from nil or null is that the concept of "nothing" is wrapped in it's own type entirely. This means that it would be a type violation for a method of return type String to ever return a None. Instead, a method that you expect to return a String or a None would need to have a union return type of (None | String).
It's analogous to Maybe, in Haskell.
Hmm. This feels a bit pedantic to me. The `is_null` check looks relegated to the FFI:
https://github.com/CausalityLtd/ponyc/blob/975d9f6c60553030e...
Obviously, I have never written anything in Pony, but this absolutely seems like an advanced use case. It exists because 'C' has a concept of null, so it needs to be handled. The manual even admits that all bets are off when dealing with the FFI.
Re:Pony – High Performance Actor Programming
by barrelrider on Sunday May 03, 2015 @08:03PM
(#9483609)
One class having a method called "is_null" doesn't mean that the language has null built into it or any inherant concept of what that means. Just like having a method called "is_functional" doesn't mean it's a functional language.
Re:Pony – High Performance Actor Programming
by thinkpad20 on Sunday May 03, 2015 @08:03PM
(#9483610)
Looks like the `handle` in question there in the File module is an instance of a Pointer, which presumably is some sort of wrapper around a raw pointer. It has null in the sense that the pointer can be null; this isn't the same thing as how nulls are traditionally used (e.g. an "empty object" which can appear in the place of where an actual object might be). So it's not a language level concept.
[1]: https://github.com/CausalityLtd/ponyc/search?utf8=%E2%9C%93&...
Also, your 3-clause BSD license only has two clauses.