From: zuzu Date: 2004-07-19T17:15:47+09:00 Subject: Re: ruby idiom for parsing function arguments? On Mon, 19 Jul 2004 16:52:08 +0900, Robert Klemme wrote: > > "zuzu" schrieb im Newsbeitrag > news:a988e9f604071816245a8892af@mail.gmail.com... > > > 2.) i would like to clarify, that this is not necessarily for reading > > ruby, the interpreter, or chmod +x .rb files, shell command lines. > > this should apply to any function/method's arguments; as in > > object.method(arg1, arg2, arg3). > > What exactly do you want to do? I mean, you don't have to parse method > arguments since that is taken care of by Ruby. > > Btw: see also "Duck Typing". > > Regards > > robert word. http://c2.com/cgi/wiki?DuckTyping my initial impression of "duck typing" was equivalent to dynamic typing, but there seems to be a little more to the mallard definition. i would appreciate an example of code demonstrating how to introspect a "hey, what kind of object are you?" message/method. i'm looking to extend ruby to the actor/dataflow model where instead of "everything is an object", "everything is an actor". as an intended side-effect, this should encourage runtime introspection/reflection and concurrency/parallelization in programming. so specifically, if i'm randomly (according to the scheduler) passing an object/actor dataflow and options as arguments, i would like a "behaviour script" to successfully differentiate them introspectively rather than explicitly (by the programmer). -z