Somehow this feels a little contradictory.
Somehow this feels a little contradictory.
When Dylan switched from Lisp syntax this was something that was fretted over an awful lot, for obvious reasons, but we went with it and it worked fine.
I'd love to see some other algebraic (non Lisp) syntax language get more creative in this direction again one day.
Common Lisp and Scheme can do this as well and I like the look of predicate functions like "list?" or "number?":
(list? object)
(number? 1) => returns true
(number? "abc") => returns false
It isn't really necessary for a language to support this, but it is a nice detail if one preferred such a style.I think the custom is to use "!" in functions with side-effects.
append(list,value)
returns a new list; append!(list,value)
modifies at least one of its arguments, typically, its first argument, but it could be another or multiple ones.By the way, all of these are conventions. The language doesn't require you to use the punctuation (http://opendylan.org/documentation/intro-dylan/expressions-v...). The conventions grow on you soon, though (I never really wrote anything in lisp or dylan, but still would like to see more flexibility in allowed characters in names)
Functions that have side effects on non-arguments should be very rare, and don't use a naming convention (see for example http://opendylan.org/documentation/library-reference/common-...)