[erlang-questions] erlang improvement - objective c (or smalltalk) syntax

Joel Reymont joelr1@REDACTED
Thu Jun 4 17:30:39 CEST 2009


On Jun 4, 2009, at 4:11 PM, Jon Gretar Borgthorsson wrote:

> Having written quite a bit in Objective-C I am a great big fan of the
> language.
> However I don't find this to be an improvement in this case. Instead  
> of
> remembering the argument order you have to remember the arguments.  
> And I
> think this might produce harder to debug errors.


What Joe is trying to do is to map the Obj-C method invocation syntax  
to Erlang for his Cocoa bridge. Granted,

[self performSelector:@selector(foo) withObject:nil afterDelay:0]

looks much better as

performSelector(self, selector:foo, withObject:nil afterDelay:0)

than

performSelector(self, [{selector, foo}, {withObject, nil},  
{afterDelay, 0}])

Here's a kicker, though... How are you going to handle  
performSelector:withObject:withObject: with the new and improved  
syntax? You can easily handle it with a list tuples, though, and you  
can use a tuple list to distinguish between the order of arguments as  
well.	

[1] http://is.gd/Oaqv

---
Mac hacker with a performance bent
http://www.linkedin.com/in/joelreymont



More information about the erlang-questions mailing list