http://www.cag.lcs.mit.edu/~rinard/paper/osdi04.pdf Objective-C takes this route by allowing message sends to nil to return nil, instead of raising an...
... Haven't read the paper yet, but I did churn out Objective-C code for several years. The feature where "messages to nil return nil" was *really* annoying...
Perl does a lot of the same kinds of stunts. From that experience, I learned that I want failure-*obvious* computing. Failure-oblivious computing seems like...
Robert Fischer
robert.fischer@...
Dec 7, 2008 1:02 am
2683
... I think it depends on the context. Floating-point software switched a long time ago from failure-obvious (throwing exceptions on overflow and underflow,...
A few years ago I had the displeasure of programming in REXX. It looked like a nice language at first, but one user-friendly feature was that a null variable...
Why not have nil be a wrapper around otherwise meaningful data as per OCaml? I hate hate hate hate hate hate hate...
Robert Fischer
robert.fischer@...
Dec 7, 2008 6:55 pm
2686
... That's mainly because interrupts are so expensive- we're talking 3000-5000 clocks each way. Which means when your code trips an error code, you just took...
I don't know OCaml (or Haskell) well enough, but is this in the same ballpark as nullable/non-nullable types, the same thing, or something completely...
Actually, Ruby has a nice approach of being able to catch exceptions at the expression level: employee.company.address.city rescue "not defined" Although the...
Also, when relying one the one-line rescue, you can't specify "this is OK to be null, but this isn't okay to be null", and the ?. encourages you to get to a...
Robert Fischer
robert.fischer@...
Dec 9, 2008 9:03 pm
2691
The inline rescue has got me thinking. In the current syntax definition for Impulse, arguments to operators are passed the unevaluated message tree --...
This looks an awful lot like Perl's "open(FOO,'bar.txt') || die 'Failed'" idiom. Based on that history, you might end up confusing people -- the symbols might...
Robert Fischer
robert.fischer@...
Dec 10, 2008 12:34 pm
2693
I was hoping it looked like the die idiom :) But you're right in that it makes it confusing to reuse a logical-or-looking symbol. You can't specify the type...
I kinda like !> -- I read that "on bang", which is about right. Store the exception in $! and you can do "!>$!" and out-Perl Perl. !! just looks funny to me...
Robert Fischer
robert.fischer@...
Dec 11, 2008 1:00 am
2695
Hi all, thanks for the good discussions around various topics, especially around nil/null and logical operators. I've recently created documentation for...
Cobra now supports extension methods on generic types, along with several refinements to the language, libraries and samples. Check out the "Cobra December...
Ruby and Groovy (and Perl) have a spread/splat operator that allows you to expand a list. How useful is this to programmers, if there is an alternative that...
Hi Chuck, I tried installing Cobra a few week ago, but ran into problems. My system drive is "I:", and it seemed to only look for the compiler on drives C:,...
I find it extremely useful: since packing/unpacking lists are so common operations, it's nice to be able to express that succinctly, because it enables a much...
Robert Fischer
robert.fischer@...
Jan 3, 2009 4:51 pm
2701
... I'm not sure a special operator is a good idea here- I really dislike having boatloads of special operators, as I can never remember what the heck they all...
The meaning of foo*.bar().baz.flatten() as Set is a lot clearer to me than Set.ofList $ concat $ map (foo . bar . baz) The distance of the operation to the...
Robert Fischer
robert.fischer@...
Jan 3, 2009 6:49 pm
2703
Thanks for the feedback guys. I think I'll go with a middle ground: bazzes = foo map: #bar | map: #baz | flatten as: <set> which is the same as: bazzes =...
... I'm not just what the "def" and "as Set" mean here, but I'm going to guess that in Io this would be: bazzes = foo select(bar) select(baz) flatten I mention...
The "as Set" converts the resulting object to a Set. The "def" is just announcing that I'm doing a declaration (like "let"). "bazzes = foo select(bar)...
Robert Fischer
robert.fischer@...
Jan 3, 2009 10:03 pm
2706
Hi Steve, glad you could join us :) Io's use of unevaluated messages is an awesome tool, but there is one small issue and maybe it can be resolved easily....
... If you want to use block instead of messages, I'd recommend using a map method designed for that: List bmap := method(b, self map(i, v, b call(i, v)))...
... This purely a function of familiarity with the idiom. Which is a problem with language design- a lot of people confuse their familiarity with the idiom...
This got caught in my spam filter for some reason. To answer your question: yes, "bar()" is just a method call. So you can call "ones*.plus(2)" or whatever. ...