From: ggarramuno@... (GGarramuno) Date: 2004-03-16T12:22:12+09:00 Subject: Re: Embedding Ruby, part 2 >1000.times() >{ > a = ls(:type => b) >} >It would be more like standard Ruby and will certainly will be simpler >to do. Sadly, it's not a good solution, for a bunch of reasons. MEL has over 200 commands just like "ls", all allowing multiple dash options. These tend to change/be added among Maya versions, too. The syntax above more or less implies I'll be parsing the options myself, which is insane work and kind of silly as MEL will do its own error checking for those. Another big feature of MEL is that it can display commands on a console from user mouse input. These follow MEL's syntax ( ie. CMD -OPTION OPT; ), and the user can easily cut/paste to repeat operations. Changing the syntax too much would make that cut/paste feature disappear for the embedded ruby. The beauty of the perl solution is that the MEL syntax is kept transparently, while all the beneftis of perl over MEL are kept. Of course, I then have to stick to perl. The third issue is a practical one. The users using ruby embedded will most likely be very familiar with MEL, but not many will be familiar with Ruby. Changing things also too much difficults the transition and the adoption for them. >module Kernel > def method_missing( symbol, *args ) > # call the corresponding MEL function > end >end > Yes, this sounds like one of the improvements I was looking for. Thanks! Now, if I could somehow trick the ruby parser into passing args from the list of tokens following the command, I'd be in business as with perl.