On Jan 6, 2008 2:40 PM, SJS <[EMAIL PROTECTED]> wrote:
> begin quoting Chuck Esterbrook as of Sun, Jan 06, 2008 at 02:28:15PM -0800:
> > On Jan 4, 2008 1:55 AM, SJS <[EMAIL PROTECTED]> wrote:
> [chop]
> > > Hm... and don't you lose that keystroke savings by having stuff like
> > > "as" and "of" as keywords? (If I'm reading the examples correctly,
> > > you use "i as int" instead of "int i", which is an additional 3
> > > keystrokes...
> >
> > Yep, but I consider names to be really important and I prefer to have
> > them up front:
> >
> > class Point
> >
> > var _x as int
> > var _y as int
> >
> > Also, if you use dynamic typing, like in Smalltalk or Python, you can
> > just leave them off:
> >
> > class Point
> >
> > var _x
> > var _y
>
> Okay. So instead of having a "dynamic type" (a la ObjC's "id"), you
> have optional static typing.... gotcha.
No it is like ObjC since "var _x" is short for "var _x as dynamic"
which you could actually type. Cobra's dynamic is like ObjC's id
except that Cobra goes a little further in making it work with
primitive types.
> Did you keep the Smalltalk(ish?) "respondsTo:" concept?
Already built into .NET since _x is still pointing to some kind of .NET type:
if obj.getType.getMember('reset')
obj.reset
But I might push this up to the language level at some point if I
provide deep integration with Objective-C:
if obj responds to 'reset'
obj.reset
If "obj" were pointing to an Objective-C object/proxy instead of a
.NET object, it would "do the right thing".
> [snip]
> > > Worked for perl, didn't it? :)
> >
> > For a time, but Python continues to rise while Perl continues to sink:
> > http://www.tiobe.com/tpci.htm
>
> Well, that's because it's the new shiny.
No, that's Ruby.
> > > I actually would be really okay with a compiler that *complained*
> > > about indentation inconsistencies.
> > >
> > > Honest!
> >
> > ???
> >
> > Are you really Stuart?
>
> Nope.
>
> Never been a Stuart.
Ah yes, Stewart.
-Chuck
--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg