From: Martin H. <ma...@he...> - 2004-02-17 21:40:52
|
Hi Xavier, Xavier VELLO wrote: >> From (briefly) looking at the evaluator, I guess it should also be >>possible to use more than one character as a delimiter, without things >>getting _too_ complicated (so, "::" or "->" should be doable). But I >>don't see the need to do the extra work, which is why I'd vote for "$". > > I vote for xmms::filename, it's the same syntax as Perl ! > In Perl, to call the function init() provided by module Gtk2, we call > Gtk2::init() or so. Great idea ! I agree that it would look nicer (or more familiar, to a coder) - but I guess it mainly comes down to how difficult it is to implement that in the evaluator. I mean, _theoretically_ it should not be difficult to implement a "look-ahead" if the evaluator finds ":" to find out if the next char is also a ":" - but as I said, I only looked briefly at the evaluator, so I can't say if it's actually as easy as it sounds. > Maybe a plugin could register multiple namespaces, but how would the > eval know them ? We fall in the same problem :/ > > Another solution would have to have : > - xmms::parse('token') > - i2c_sensors::parse('token') > - proc_stat::parse('token') > - proc_stat::disk('token') > - proc_stat::cpu('token', 'delay') > - ... > So a plugin may have multiple functions, and one-function plugins > register only a generic parse() function. What about it ?? Well, after checking the existing code of the plugins (and lots of editing this email...), that would sound like a very good idea to me, if we can get rid of the (somewhat redundant) "parse". Maybe something like a "default function", if only the name of a plugin is supplied? this would make it xmms('token') i2c_sensors('token') proc_stat('token') proc_stat::disk('token') proc_stat::cpu('token', 'delay') Which would look pretty appealing to me. We'd have the best of both (especially being able to have functions, that take more than just one parameter) What do you think? Martin -- You think that's tough? Try herding cats! |