Mailinglist Archive: yast-devel (116 mails)

< Previous Next >
Re: [yast-devel] new YCP builtins
  • From: Martin Vidner <mvidner@xxxxxxx>
  • Date: Thu, 5 Jun 2008 10:16:27 +0200
  • Message-id: <20080605081627.GB8704@xxxxxxxxxxxxxxxx>
Hi,

On Wed, Jun 04, 2008 at 08:59:49PM +0200, Lukas Ocilka wrote:
Let's wait for others to comment. Adding new builtins is a good thing if
more developers find them useful. Otherwise it just adds unneeded
complexity to both core and YCP code and makes the code harder to read.

I recognize that new functions make programming easier, so I would
like to see more of them. On the other hand, new builtins come in
the global namespace and thus create conflict with existing
identifiers (it has been the case with every improvement to YCP:
"default", "getenv"...).

So we have to make a digression and put the new features into a
"namespace" or whatever, so that the language stays backward
compatible.

I am thinking of allowing type names as namespaces for builtins:

list<string> l = [ "0", "a", "1", "2", "b", "3", "4" ];
list<string> spl = list::split(string s, l, { return isalpha(s); });

list<integer> l1 = [ 1, 2, 3 ];
integer min = list::reduce(integer x, integer y, l1[0]:nil, l1, {return x < y
? x : y; });

Any other ideas how to solve this? Problems?
It seems that I should prototype this pretty soon so that we can
move forward.

(See also these from my bug collection:)
- bnc#198077 "how to introduce new builtins to YCP"
- bnc#55163 list::findfirstof
- bnc#58844 set::intersection, set::difference,
set::symmetric_difference (any similarities with python are purely
intentional)
- bnc#231719 string::iregexpmatch, string::iregexpsub

--
Martin Vidner, YaST developer
http://en.opensuse.org/User:Mvidner

Kuracke oddeleni v restauraci je jako fekalni oddeleni v bazenu
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >