It looks horrible, but actually it's very easy to pick up.
[Circle createAtX:1 Y:2 withRadius:3]
roughly equals
Circle::create(1,2,3)
Once you go past syntax (that's so crazy to avoid collisions with C), it's all sweet.
XCode has code completion, so verbose named arguments are not a problem, but actually make code easier to understand (you don't have to wonder which argument is which).
There are many nice things:
calling method on null is perfectly legal and doesn't segfault. This way you can chain methods and get sort-of monads.
it has class mixins (protocols)
run-time class reflection/introspection, and calling of methods by name allows duck typing
in Leopard and GNUStep there's GC for ObjC objects
it's all fully backwards compatible with C (you can mix it however you like, there's no extern C ghetto)
Not exactly, since it loses all the meaning of the keywords (and self-explanatory power). So either move to smalltalk (which has the same syntax) or translate to Python + kwdargs which keeps most of the meaning (but not all of it):
Otherwise there is a default container based on what the type of thing is being created (e.g. 'Person' vs. 'Group' vs. 'Container', etc.). I had a DSL in Tcl which I really liked, but now we are using Python which has rejected my mind's attempts to bend it to my will of "I want to type only the information which is new" and "No I don't want to write a crazy string and then parse it" (e.g. myLib.exec("create Person with uid=foo mail=[email protected] at c=us" -- I hate this kind of trick when Tcl made it so easy...)
root = Root()
person = root.create("Person")
// we know identifier is a special
identifier = person.create("Identifier")
identifier.set("dn", "uid=foo,c=us")
person.set("mail", "[email protected]")
return service.update(root)
Also delete, etc. So we have on the one had creation of a data object for a call, and also the use of that data object in a call. Ideally it would be a one-line command so that I can give myself a Pythonic command line for the system.
-9
u/[deleted] Apr 14 '08
that language looks pretty horrible...