David Wheeler <[EMAIL PROTECTED]> writes:

> On 5/11/02 2:43 PM, "Damian Conway" <[EMAIL PROTECTED]> claimed:
> 
> > method set_baz($newbaz is compatible($.baz)) { $.baz = $newbaz }
> > method set_baz($newbaz is typeof($.baz)) { $.baz = $newbaz }
> 
> I like the latter best -- and it beats the hell out of "instanceof" ;-)

talking about instanceof, here are the various syntaxes:

* testing class membership

  x isa                    x Perl     x
  x is_a? kind_of?         x Ruby     x
  x dynamic_cast           x C++      x
  x instanceof             x Java     x
  x isinstance             x Python   x
  x in                     x Ada      x
  x is                     x C#       x
  x is_a                   x PHP      x
  x entry_type             x Pliant   x
  x ISTYPE                 x Modula-3 x
  x object## < classname## x Beta     x
  x var ?= val (20)        x Eiffel   x

* get the class corresponding to an object/instance

  x type      x Ruby   x
  x __class__ x Python x
  x getClass  x Java   x
  x typeid    x C++    x

if you know some more, tell me :)

http://merd.net/pixel/language-study/syntax-across-languages.html

Reply via email to