From: Michael R. <re...@eu...> - 2004-02-17 06:00:54
|
Hi Martin, Hi Xavier, > Ok, maybe I'm missing something obvious here - but if we want to take > the easy routem, why can't we simply define that a function name > consists of > plugin_name + delimiter + function_name ? Ahh... > > If you want to make it look like OOP, you can use "." for a delimiter > (but it may screw up the parser, since "." is already used for string > concatenation). Right. A dot would look nice, but will not work. Maybe a ':' ?? (no, impossible, because of the a?b:c) I'm afraid we run out of delimiters :-) > The user must know which functions exist (and most naturally, that would > be documented on a "per plugin" basis, so the user would also know which > plugin the function belongs to). Actually, it might even make the > config-file more clear (since the plugin-name gives the function a > context, so it's easier to understand what's going on). It would > probably even solve the "duplicate function name" problem, since we > could think of each plugin as a name-space. What I'm thinking about here > is this: > the xmms plugin has a function "filename" (I don't know if it does, but > lets assume it does). If you know you're talking about xmms, "filename" > makes sense (pobably the name of the file currently being played). > If someone else is writing a "plugin_printspooler", "filename" might be > the name of the file currently being printed. In both cases, it's a > filename, but I guess it would be nice to know (simply from looking at > the config) which plugin is being used by a statement in the setup. Martin - that's why I've been waiting for your comments :-) I really LOVE this idea! It solves all our issues, and is a win-win solution! It gives us the same results as the "global function to plugin mapping", but easier to implement (no compile-time work necessary), and allows for modules to be used without recompiling all the stuff. It does not require a list of modules to be specified in the config file. Great! Xavier, what's your opinion? -- Michael Reinelt Tel: +43 676 3079941 Geisslergasse 4 Fax: +43 316 692343 A-8045 Graz, Austria e-mail: re...@eu... |