My advice is to stick with
function.
It is less ugly than it seems ... Ruby has spoiled you. The success of JQuery I think proves my point ... it is not a significant obstalce in Javascript land, since developers are used to a slightly clunkier C-derived syntax anyway.
The only way to do something like this is to do what this guy did, and parse the code. At that point, you get into a number of issues, particularly semantics (how do you pass an argument?), debugging, and performance. It isn't worth it just to get rid of a keyword.
Remember, that Nice (the RSD-based library I want to add on top of Polish for my own talk later in September) will solve this problem anyway. So I would say, let Polish be what it is, a Javascript library, and let Nice be there when you want to make it look ... nice.
This also keeps each layer in our emerging little client-side framework nice and focused. Cappucino worries about widgetry, Polish worries about making it dead-simple to programmatically construct UIs, and Nice worries about making it dead-simple to do it declaratively.
One last thought on this ... Keep in mind that Nice will not need to generate Javascript. It is essentially an interpreter that executes using Polish. Up until the Nice stylesheet itself is loaded, we are relying entirely on the native browser's (increasingly) powerful Javascript compilation. By that time, 90% of the real work is finished, and all we're doing is simply mapping parsing events to Polish functions.
This, by the way, is also an advantage of using markup to create structure, since the DOM tree will already have been constructed by the time the Nice stylesheet begins running, reducing the amount of work being done on the fly. However, I'm not sure how easy that is to reconcile with Cappucino.
Dan