3 ms·
It's not really in the shape I would have wanted for a public release... kudos to the submitter for finding the website, I guess :). But if you find it useful,
by avibryant 17y ago
It's not really in the shape I would have wanted for a public release... kudos to the submitter for finding the website, I guess :). But if you find it useful, great.
- tumult 17y agoI always thought Smalltalk seemed like a closer match to JS than Scheme, if you got rid of first-class message passing. How much overhead is there? For example in Objective-J in reasonably tight loops, I usually try to avoid message passing or using the Cappuccino types if I can. JS is already pretty slow in IE and older browsers, and UI updates can become noticeably slower with more overhead.
- avibryant 17y agoThere's no overhead, in the sense that one Smalltalk message send maps to one Javascript method call. However, Smalltalk tends to use more, smaller methods, and more blocks, so there's some stylistic overhead that will make idiomatic Clamato slower than idiomatic Javascript.
- tlrobinson 17y agoDoes it support doesNotUnderstand?
- avibryant 17y agoNope. The goal here is not to duplicate every aspect of Smalltalk, only the ones that map easily to Javascript.
- sachinag 17y agoI thought Clamato was primarily a Mexican thing for Chelada (you can get pre-mixed Clamato and Budweiser in Mexico and Mexican areas in Chicago and other cities). I thought you Canadians were better than that. shakes head
- delano 17y agoTo the best of my recollection Clamato juice was created for the first time in Boston or New Jersey, but popularized via the Caesar in Calgary (like a Bloody Mary with Clamato instead of tomato). Either way, it's a prevalent drink in Canada and difficult or impossible to find elsewhere.
- BigZaphod 17y agoNo need for recollections when we have Wikipedia! http://en.wikipedia.org/wiki/Clamato http://en.wikipedia.org/wiki/Clamato Memory is so fallible anyway - why even use it? :P
- BigZaphod 17y agoSorry Avi - it's just so darned compelling... :P
- avibryant 17y agoYou can do penance by submitting some patches.
- stcredzero 17y agoThere are several departures from Smalltalk’s syntax and semantics. The most notable of these are: no explicit returns, 0-based indexing, no metaclass hierarchy, special syntax for instance variables. I can live with no metaclasses. Special syntax for instance variables isn't that much of a problem. 0-based indexing -- this should be easy to take care of with your own collection classes. However, no explicit returns -- this one kills me. I guess this has to do with Javascript. EDIT: JS has exception handling, so this could be used to implement explicit returns.
- abbat 17y agoI suggest some relization of explicit conditional return for Clamato: http://sites.google.com/site/abbatfilestore/clamato/cookbook/explicitconditionalreturnsupport http://sites.google.com/site/abbatfilestore/clamato/cookbook... Also, please join to Clamato google group: http://groups.google.com/group/clamato-smalltalk/ http://groups.google.com/group/clamato-smalltalk/
- gruseom 17y agoThe problem with using exception handling for explicit returns is that you'd need to put a try/catch block at the top level of every function. That seems yuck. Or am I missing something?
- avibryant 17y agoExactly. For those times that you really need them, I added a #return: method that you can use explicitly: self return: [:ret | .... ret value: foo ...]. But you only pay the cost of the try/catch/throw when you actually use it. FWIW, I've found that the lack of explicit returns really isn't a problem, at least in the code I've written and ported so far.
- gruseom 17y agoI've been offline for a few days and just read this: But you only pay the cost of the try/catch/throw when you actually use it. Do you mean that the existence of an explicit return is recognized at compile time, so only the functions that actually contain one need to be wrapped in a try-catch? Now that I think of it, that seems like the best way to do it. I've wanted to be able to compile return-from into JS for a while...