On Thursday, June 12, 2014 1:08:37 PM UTC-4, Aerlinger wrote: > > Ruby has a useful convention where methods can end in a '?' to indicate > that it returns a boolean value. This capability would be useful in Julia > as well. Much like the bang (!) suffix on functions it might look something > like this: > > function isEven?(n::Int) > n % 2 == 2 > end >
Yes, both the ! and ? suffixes are common conventions, possibly originating in Scheme. Note that if you have a ? suffix, then you don't need the "is" prefix. However, ? is already being used for the ternary operator in Julia and hence is not available for use in identifiers. Hence we instead adopt the "is" prefix convention.
