enumerations

0 views
Skip to first unread message

theZoot

unread,
Jan 16, 2008, 2:33:58 PM1/16/08
to LSharp
How does one refer to .NET enumerations such as
System.Text.RegularExpressions.RegexOptions?

Ian D

unread,
Jan 16, 2008, 7:20:13 PM1/16/08
to LSharp
The following works:

(Compiled System.Text.RegularExpressions.RegexOptions)

As for "or"ing FlagAttribute enums together, that I don't know yet.

Ian D

theZoot

unread,
Jan 17, 2008, 8:15:23 AM1/17/08
to LSharp
I must be missing something. When I try:
(pr (Compiled System.Text.RegularExpressions.RegexOptions))

I only get an error, but I appreciate your response.

theZoot

unread,
Jan 17, 2008, 9:14:23 AM1/17/08
to LSharp
Sorry about that. I don't know what I did to mess things up the first
time, but now it is working just fine. Thanks a bunch

theZoot

unread,
Jan 17, 2008, 9:27:40 AM1/17/08
to LSharp
Oh, and as far the bitwise or on the values from enumerations, it
seems that they're of the specific type of enumeration they are and
the | function isn't defined except for integers (I'm guessing here).
So, if you cast the type into an integer things should work fine.
Maybe there's some way to use the the function, but this is the first
thing that popped into my head. It's a little silly, but it works:

(|
(+ 0 (compiled System.Text.RegularExpressions.RegexOptions))
(+ 0 (cultureinvariant System.Text.RegularExpressions.RegexOptions))
)

The + function seems to treat them as integers just fine and return an
integer.
Reply all
Reply to author
Forward
0 new messages