1. Enum?
- Posted by Jeremy Cowgar <jeremy at ?o?gar.com> May 14, 2008
- 799 views
- Last edited May 15, 2008
I do this all the time and I know others do because I see in it code everywhere. Here are some examples, some of which you will recognize:
constant FILE_NO = 1, -- file number LINE_NO = 2, -- local line number FILE_PTR = 3, -- open file number FILE_START_SYM = 4, -- symbol before start of file OP_WARNING = 5, -- save/restore with/without options OP_TRACE = 6, OP_TYPE_CHECK = 7, OP_PROFILE_TIME = 8, OP_PROFILE_STATEMENT = 9, OP_DEFINES = 10 -- ifdef defines global constant GET_SUCCESS = 0, GET_EOF = -1, GET_FAIL = 1, GET_NOTHING = -2 global constant D_NAME = 1, D_ATTRIBUTES = 2, D_SIZE = 3, D_YEAR = 4, D_MONTH = 5, D_DAY = 6, D_HOUR = 7, D_MINUTE = 8, D_SECOND = 9
Etc... This is fine, but what if you want to add a new element and not at the end? I am sure we've all done it. Well, I borrowed a good thing from other languages called an enum (enumeration)... I've done the code already but have not committed. What do you think?
global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL printf(1, "name=%d, attributes=%d, size=%d\n", { D_NAME, D_ATTRIBUTES, D_SIZE}) printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) -- name=1, attributes=2, size=3 -- person_name=1, age=5, dob=6, email=7
An enum is not a new type, it emits a constant. They can be local or global. I think it has a lot of benefit but wanted to get community input. -- Jeremy Cowgar http://jeremy.cowgar.com
2. Re: Enum?
- Posted by Alan F <acf.projects at gmail?co?> May 15, 2008
- 778 views
Jeremy Cowgar wrote: > Etc... This is fine, but what if you want to add a new element and not at the > end? I am sure we've all done it. Well, I borrowed a good thing from other > languages > called an enum (enumeration)... I've done the code already but have not > committed. > What do you think? > > }}} <eucode> > global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... > global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL > > printf(1, "name=%d, attributes=%d, size=%d\n", { > D_NAME, D_ATTRIBUTES, D_SIZE}) > printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { > PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) > > -- name=1, attributes=2, size=3 > -- person_name=1, age=5, dob=6, email=7 > </eucode> {{{ > > An enum is not a new type, it emits a constant. They can be local or global. > I think it has a lot of benefit but wanted to get community input. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> I think this is a very good idea. This seems like a relatively safe change to make, as it only affects the front-end. With something like this in the language, I think we could stop worrying about how/whether to implement structures, as this pretty much takes care of that.
3. Re: Enum?
- Posted by c.k.lester <euphoric at ?kleste?.com> May 15, 2008
- 750 views
Jeremy Cowgar wrote: > > An enum is not a new type, it emits a constant. They can be local or global. > I think it has a lot of benefit but wanted to get community input. I've always wanted this kind of functionality, but got by without it. It would be interesting to see how much code this would replace in the archive.
4. Re: Enum?
- Posted by Kat <KAT12 at coo?a?s.net> May 15, 2008
- 775 views
Alan F wrote: > > Jeremy Cowgar wrote: > > Etc... This is fine, but what if you want to add a new element and not at > > the > > end? I am sure we've all done it. Well, I borrowed a good thing from other > > languages > > called an enum (enumeration)... I've done the code already but have not > > committed. > > What do you think? > > > > }}} <eucode> > > global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... > > global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL > > > > printf(1, "name=%d, attributes=%d, size=%d\n", { > > D_NAME, D_ATTRIBUTES, D_SIZE}) > > printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { > > PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) > > > > -- name=1, attributes=2, size=3 > > -- person_name=1, age=5, dob=6, email=7 > > </eucode> {{{ > > > > An enum is not a new type, it emits a constant. They can be local or global. > > I think it has a lot of benefit but wanted to get community input. > > > > -- > > Jeremy Cowgar > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > I think this is a very good idea. This seems like a relatively safe change to > make, as it only affects the front-end. With something like this in the > language, > I think we could stop worrying about how/whether to implement structures, as > this > pretty much takes care of that. Static structures, yeas. Still, go for it, Jeremy! Kat
5. Re: Enum?
- Posted by irv mullins <irvm at el?ijay.?om> May 15, 2008
- 755 views
Kat wrote: > > Alan F wrote: > > > > Jeremy Cowgar wrote: > > > Etc... This is fine, but what if you want to add a new element and not at > > > the > > > end? I am sure we've all done it. Well, I borrowed a good thing from other > > > languages > > > called an enum (enumeration)... I've done the code already but have not > > > committed. > > > What do you think? > > > > > > }}} <eucode> > > > global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... > > > global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL > > > > > > printf(1, "name=%d, attributes=%d, size=%d\n", { > > > D_NAME, D_ATTRIBUTES, D_SIZE}) > > > printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { > > > PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) > > > > > > -- name=1, attributes=2, size=3 > > > -- person_name=1, age=5, dob=6, email=7 > > > </eucode> {{{ > > > > > > An enum is not a new type, it emits a constant. They can be local or > > > global. > > > I think it has a lot of benefit but wanted to get community input. > > > > > > -- > > > Jeremy Cowgar > > > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> > > > > I think this is a very good idea. This seems like a relatively safe change > > to > > make, as it only affects the front-end. With something like this in the > > language, > > I think we could stop worrying about how/whether to implement structures, as > > this > > pretty much takes care of that. > > Static structures, yeas. Still, go for it, Jeremy! > > Kat It would have saved me - no exaggeration - several day's work. Please add enums.
6. Re: Enum?
- Posted by Derek Parnell <ddparnell at ?igpond.com> May 15, 2008
- 790 views
Jeremy Cowgar wrote: > > I do this all the time and I know others do because I see in it code > everywhere. > Here are some examples, some of which you will recognize: Yes, I do this OFTEN! However, I use a execute-time mechanism to make it less error prone ...
include series.e constant sFILE = next-number(0), FILE_NO = next-number(sFILE), LINE_NO = next-number(sFILE), FILE_PTR = next-number(sFILE), FILE_START_SYM = next-number(sFILE), OP_WARNING = next-number(sFILE), OP_TRACE = next-number(sFILE), OP_TYPE_CHECK = next-number(sFILE), OP_PROFILE_TIME = next-number(sFILE), OP_PROFILE_STATEMENT = next-number(sFILE), OP_DEFINES = next-number(sFILE), maxFILE = current-number(sFILE)
> What do you think? This idea would be a good addition to the language. It is good because it happens at parser-time and not execute-time like my solution does. Just an an idle thought, it is sometimes useful to know the first and last values (the range) of an enumeration. Can you think of a syntax that would give us this? Maybe something like this, borrowing from RegEx syntax ...
enum FILE_NO, LINE_NO, FILE_PTR, FILE_START_SYM, OP_WARNING, OP_TRACE, OP_TYPE_CHECK, OP_PROFILE_TIME, OP_PROFILE_STATEMENT, OP_DEFINES, minFILE=^, -- first enumeration value maxFILE=$ -- last enumeration value
-- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
7. Re: Enum?
- Posted by Jason Gade <jaygade at yah?o.?om> May 15, 2008
- 755 views
Jeremy Cowgar wrote: > > I do this all the time and I know others do because I see in it code > everywhere. > Here are some examples, some of which you will recognize: > > }}} <eucode> > constant FILE_NO = 1, -- file number > LINE_NO = 2, -- local line number > FILE_PTR = 3, -- open file number > FILE_START_SYM = 4, -- symbol before start of file > OP_WARNING = 5, -- save/restore with/without options > OP_TRACE = 6, > OP_TYPE_CHECK = 7, > OP_PROFILE_TIME = 8, > OP_PROFILE_STATEMENT = 9, > OP_DEFINES = 10 -- ifdef defines > > global constant GET_SUCCESS = 0, > GET_EOF = -1, > GET_FAIL = 1, > GET_NOTHING = -2 > > global constant > D_NAME = 1, > D_ATTRIBUTES = 2, > D_SIZE = 3, > D_YEAR = 4, > D_MONTH = 5, > D_DAY = 6, > D_HOUR = 7, > D_MINUTE = 8, > D_SECOND = 9 > </eucode> {{{ > > Etc... This is fine, but what if you want to add a new element and not at the > end? I am sure we've all done it. Well, I borrowed a good thing from other > languages > called an enum (enumeration)... I've done the code already but have not > committed. > What do you think? > > }}} <eucode> > global enum D_NAME, D_ATTRIBUTES, D_SIZE, ... > global enum PERSON_NAME, PERSON_AGE=5, PERSON_DOB, PERSON_EMAIL > > printf(1, "name=%d, attributes=%d, size=%d\n", { > D_NAME, D_ATTRIBUTES, D_SIZE}) > printf(1, "person_name=%d, age=%d, dob=%d, email=%d\n", { > PERSON_NAME, PERSON_AGE, PERSON_DOB, PERSON_EMAIL}) > > -- name=1, attributes=2, size=3 > -- person_name=1, age=5, dob=6, email=7 > </eucode> {{{ > > An enum is not a new type, it emits a constant. They can be local or global. > I think it has a lot of benefit but wanted to get community input. > > -- > Jeremy Cowgar > <a href="http://jeremy.cowgar.com">http://jeremy.cowgar.com</a> Yes, I think with the ubiquity of sequences and how they are used to simulate structures sometimes, enumerated constants would be a welcome addition. -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.
8. Re: Enum?
- Posted by Alan F <acf.projects at ?ma?l.com> May 15, 2008
- 756 views
Derek Parnell wrote: > > Just an an idle thought, it is sometimes useful to know the first and last > values > (the range) of an enumeration. Can you think of a syntax that would give us > this? Maybe something like this, borrowing from RegEx syntax ... > > }}} <eucode> > enum > FILE_NO, > LINE_NO, > FILE_PTR, > FILE_START_SYM, > OP_WARNING, > OP_TRACE, > OP_TYPE_CHECK, > OP_PROFILE_TIME, > OP_PROFILE_STATEMENT, > OP_DEFINES, > minFILE=^, -- first enumeration value > maxFILE=$ -- last enumeration value > </eucode> {{{ > > -- > Derek Parnell > Melbourne, Australia > Skype name: derek.j.parnell From what I understand, the first entry in any 'enum' statement is always set to 1. However, the 'last enumeration value' option would be useful (for example, to define a sequence of that length for holding a structure), but I wasn't and still am not sure what would be good syntax for this. I'm not so sure about the $ syntax proposed.
9. Re: Enum?
- Posted by Jeremy Cowgar <jeremy at c?wgar?com> May 15, 2008
- 762 views
> From what I understand, the first entry in any 'enum' statement is always > set to 1. However, the 'last enumeration value' option would be useful > (for example, to define a sequence of that length for holding a structure), > but I wasn't and still am not sure what would be good syntax for this. I'm not > so sure about the $ syntax proposed. Actually, you can set it to anything you want. It defaults to 1 if nothing is given...
enum NAME=20,AGE,DOB -- 20,21,22 enum ENGINE,WHEELS,MUFFLER -- 1,2,3 enum A=-3,B,C,D,E,F -- -3, -2, -1, 0, 1, 2 enum A,B,C,D=10,E,F -- 1,2,3,10,11,12
-- Jeremy Cowgar http://jeremy.cowgar.com
10. Re: Enum?
- Posted by Derek Parnell <ddparnell at ?igpond.co?> May 15, 2008
- 761 views
Alan F wrote: > From what I understand, the first entry in any 'enum' statement is always > set to 1. Actually it turns out that this is not always the case. Consider ... enum FAILURE = -1, OKAY enum WM_USER = #0400, WM_NOTIFY, WM_DROPDOWN In these cases, the first item is not 1. There is also the case where a coder does this ... enum OPTA = 2, OPTB = 9, OPTC = 0, OPTD = 7 Here the 'first' one is 2, the 'minimum' one is 0, then 'number of values' is 4, the 'last' one is 7 and the 'maximum' one is 9. All these properties (okay maybe not first and last) are useful to know. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
11. Re: Enum?
- Posted by gshingles <gshingles at ?mail.c?m> May 15, 2008
- 750 views
Derek Parnell wrote: > }}} <eucode> > enum > FILE_NO, > LINE_NO, > FILE_PTR, > FILE_START_SYM, > OP_WARNING, > OP_TRACE, > OP_TYPE_CHECK, > OP_PROFILE_TIME, > OP_PROFILE_STATEMENT, > OP_DEFINES, > minFILE=^, -- first enumeration value > maxFILE=$ -- last enumeration value > </eucode> {{{ At first I didn't understand it, but after reading other proposals, I like this idea the best. I was wondering how you would determine the range of an enum from one of its members but if I understand what you are proposing, the ^ and $ symbols are valid from the start to the end of the enum statement. This seems the simplest for a compile-time feature, however does the entry 'minFILE' count against the value of maxFILE? :) ie from your example above: intent: minFILE = 1, maxFILE = 10 actual: minFILE = 1, maxFILE = 11 (because of minFILE) Maybe you could just store these in constants with ^ and $ available until the next enum keyword is encountered? They would have to be better named though because of $ being used for slices. eg enum_start, enum_end, enum_count ? But for the sake of not having to change 50 lines of code to insert a 'record' in a sequence I'm all for this change regardless. Gary
12. Re: Enum?
- Posted by CChris <christian.cuvier at ?gr?culture.gouv.fr> May 15, 2008
- 740 views
gshingles wrote: > > Derek Parnell wrote: > > }}} <eucode> > > enum > > FILE_NO, > > LINE_NO, > > FILE_PTR, > > FILE_START_SYM, > > OP_WARNING, > > OP_TRACE, > > OP_TYPE_CHECK, > > OP_PROFILE_TIME, > > OP_PROFILE_STATEMENT, > > OP_DEFINES, > > minFILE=^, -- first enumeration value > > maxFILE=$ -- last enumeration value > > </eucode> {{{ > > At first I didn't understand it, but after reading other proposals, I like > this > idea the best. > > I was wondering how you would determine the range of an enum from one of its > members > but if I understand what you are proposing, the ^ and $ symbols are valid from > the > start to the end of the enum statement. > > This seems the simplest for a compile-time feature, however > does the entry 'minFILE' count against the value of maxFILE? :) > > ie from your example above: > intent: minFILE = 1, maxFILE = 10 > actual: minFILE = 1, maxFILE = 11 (because of minFILE) > > Maybe you could just store these in constants with ^ and $ available > until the next enum keyword is encountered? They would have to be better > named though because of $ being used for slices. eg enum_start, enum_end, > enum_count ? > > But for the sake of not having to change 50 lines of code to insert a 'record' > in a sequence I'm all for this change regardless. > > Gary Me too. CChris
13. Re: Enum?
- Posted by Derek Parnell <ddparnell at ??gpond.com> May 15, 2008
- 741 views
gshingles wrote: > I was wondering how you would determine the range of an > enum from one of its members but if I understand what > you are proposing, the ^ and $ symbols are valid from > the start to the end of the enum statement. I was just 'shooting from the hip'. It was not a thought out proposal or syntax. > does the entry 'minFILE' count against the value of maxFILE? :) But now I've got a bit of time I'll flesh it out a bit more... There are three properies of an enumeration that can be useful to know: (1) The number of elements in the enumeration. (2) The value of the lowest item. (3) The value of the highest item. All of these are known to the parser. I propose that in addition to setting values in an enumeration, that three special tokens can be used that denote these three properities on an enumeration. The tokens I propose are these below ... (but please feel free to come up with better ones) (1) enum:length (2) enum:min (3) enum:max When used in an enumeration declaration, they do not themselves become values in the enumeration. Example:
enum FILE_NO, LINE_NO, FILE_PTR, FILE_START_SYM, OP_WARNING=-1, OP_TRACE=-2, OP_TYPE_CHECK=0, OP_PROFILE_TIME=18, OP_PROFILE_STATEMENT=3, OP_DEFINES=9, minFILE=enum:min, -- lowest enumeration value maxFILE=enum:max, -- highest enumeration value lenFILE=enum:length -- count of items in THIS enumeration
This is equivalent to ...
constant FILE_NO = 1, LINE_NO = 2, FILE_PTR = 3, FILE_START_SYM = 4, OP_WARNING = -1, OP_TRACE = -2, OP_TYPE_CHECK = 0, OP_PROFILE_TIME = 18, OP_PROFILE_STATEMENT = 3, -- note duplicates are okay OP_DEFINES = 9, minFILE = -2, -- lowest enumeration value maxFILE = 18, -- highest enumeration value lenFILE = 10 -- count of items in THIS enumeration
If used, the special enumeration values MUST be the last ones in the declaration and each one can be used any number of times (0 or more) before the end of the enumeration. -- Derek Parnell Melbourne, Australia Skype name: derek.j.parnell
14. Re: Enum?
- Posted by "Euler German" <eulerg at gmail.com> May 15, 2008
- 787 views
> On 14 May 2008 at 19:08, Alan F wrote (maybe snipped): > From what I understand, the first entry in any 'enum' statement is > always > set to 1. However, the 'last enumeration value' option would be useful > (for example, to define a sequence of that length for holding a > structure), but I wasn't and still am not sure what would be good > syntax for this. I'm not so sure about the $ syntax proposed. > $ makes sense. It is "euphoric" alright (subscripts), but I'm not sure about the convenience of "^". Well, I could used to it some day, but can't get the point. Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com
15. Re: Enum?
- Posted by CChris <christian.cuvier at a?riculture.gouv.?r> May 15, 2008
- 736 views
Euler German wrote: > > > On 14 May 2008 at 19:08, Alan F wrote (maybe snipped): > > > From what I understand, the first entry in any 'enum' statement is > > always > > set to 1. However, the 'last enumeration value' option would be useful > > (for example, to define a sequence of that length for holding a > > structure), but I wasn't and still am not sure what would be good > > syntax for this. I'm not so sure about the $ syntax proposed. > > > > $ makes sense. It is "euphoric" alright (subscripts), but I'm not > sure about the convenience of "^". Well, I could used to it some day, > but can't get the point. > > Euler > In any regular expression description I heard about, ^ stands for start of line and $ for end of line. Eu will have regular expressions, so these symbols make sense for first/last term of enum. They are not part of an anum. Of course, this_enum.start and this_enum.end are more explicit and clear. CChris > -- > _ > _| euler f german > _| sete lagoas, mg, brazil > _| efgerman{AT}gmail{DOT}com > >
16. Re: Enum?
- Posted by "Euler German" <eulerg at gmail.com> May 15, 2008
- 756 views
> On 15 May 2008 at 9:56, CChris wrote (maybe snipped): > In any regular expression description I heard about, ^ stands for > start of line and $ for end of line. Eu will have regular expressions, > so these symbols make sense for first/last term of enum. They are not > part of an anum. > > Of course, this_enum.start and this_enum.end are more explicit and > clear. > > CChris > Yeah, I know. Just avoiding a mix-up. Besides, Derek already changed his mind on syntax used. :) I like regexes very much and use them very often, so I got used to its terse, cryptic syntax, but could we leave this *only* for regex strings? ;) Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com
17. Re: Enum?
- Posted by gshingles <gshingles at gmail.c?m> May 16, 2008
- 765 views
Derek Parnell wrote: > The tokens I propose are these below ... (but please feel free to come up with > better ones) > (1) enum:length > (2) enum:min > (3) enum:max > > When used in an enumeration declaration, they do not themselves become values > in the enumeration. > > Example: > > }}} <eucode> > enum > FILE_NO, > LINE_NO, > FILE_PTR, > FILE_START_SYM, > OP_WARNING=-1, > OP_TRACE=-2, > OP_TYPE_CHECK=0, > OP_PROFILE_TIME=18, > OP_PROFILE_STATEMENT=3, > OP_DEFINES=9, > minFILE=enum:min, -- lowest enumeration value > maxFILE=enum:max, -- highest enumeration value > lenFILE=enum:length -- count of items in THIS enumeration > </eucode> {{{ Yep. Looks good, if a bit wordy. Isn't ':' for namespaces, or did that become '.' last week? If it is ':' you might have to do a bit of gymnastics in case you have a namespace 'enum' ? I'm for whatever works though and provides the most features with the least barriers to speedy implementation. Gary
18. Re: Enum?
- Posted by gshingles <gshingles at ?mail.c?m> May 16, 2008
- 750 views
Euler German wrote: > > > On 14 May 2008 at 19:08, Alan F wrote (maybe snipped): > > > From what I understand, the first entry in any 'enum' statement is > > always > > set to 1. However, the 'last enumeration value' option would be useful > > (for example, to define a sequence of that length for holding a > > structure), but I wasn't and still am not sure what would be good > > syntax for this. I'm not so sure about the $ syntax proposed. > > > > $ makes sense. It is "euphoric" alright (subscripts), but I'm not > sure about the convenience of "^". Well, I could used to it some day, > but can't get the point. $ and ^ are used in regular expressions to denote 'to the end of it' and 'from the beginning of it', respectively. I personally think we should stay away from Perl syntax as much as possible. It's refreshing to program in a language where you don't have to use as many ! at #$%^&*\ symbols. (But that doesn't mean I don't think we could borrow some more Perl-ish _concepts_) Gary
19. Re: Enum?
- Posted by gshingles <gshingles at gmail?co?> May 16, 2008
- 747 views
gshingles wrote: > I personally think we should stay away from Perl syntax as much as possible. > It's refreshing to program in a language where you don't have to use as many ! > at > #$%^&*\ symbols. Well that kind of ruined the impact of the pun... "a language where you don't have to use as many !#$%^& symbols."
20. Re: Enum?
- Posted by "Euler German" <eulerg at gmail.com> May 16, 2008
- 767 views
> On 15 May 2008 at 20:39, gshingles wrote (maybe snipped): > Euler German wrote: > > > > > On 14 May 2008 at 19:08, Alan F wrote (maybe snipped): > > > > > From what I understand, the first entry in any 'enum' statement > > > is always > > > set to 1. However, the 'last enumeration value' option would be > > > useful (for example, to define a sequence of that length for > > > holding a structure), but I wasn't and still am not sure what > > > would be good syntax for this. I'm not so sure about the $ syntax > > > proposed. > > > > > > > $ makes sense. It is "euphoric" alright (subscripts), but I'm not > > sure about the convenience of "^". Well, I could used to it some > > day, but can't get the point. > > $ and ^ are used in regular expressions to denote 'to the end of it' > and 'from the beginning of it', respectively. > > I personally think we should stay away from Perl syntax as much as > possible. It's refreshing to program in a language where you don't > have to use as many ! at #$%^&*\ symbols. > > (But that doesn't mean I don't think we could borrow some more > Perl-ish _concepts_) > Gary, Perl regex syntax is sort of reference for regular expressions. If PCRE (Perl Compatible Regular Expressions) is the choice, that's what we'll be using. I think there'll be no problem to use PCRE's regex patterns strings (in fact, I think it's good) but that'll be only for passing the pattern to regex engine. All the rest shall be plain Euphoria. Euler -- _ _| euler f german _| sete lagoas, mg, brazil _| efgerman{AT}gmail{DOT}com