Oops, I've got a testGroup I need to check in for this.  That might have helped. 

On Dec 30, 2007 1:07 PM, Mark Miesfeld <miesfeld@gmail.com> wrote:
Rick is probably the only one that knows this answer.

I've been looking forward to the constant directive, so I went to try
it with 1916.  This is how I expected it to work:

 say 'This is only a test'

 say 'The value of pi:' MathConstants~PI
 say 'Biggest long:   ' MathConstants~MAX_LONG
 say 'Smallest long:  ' MathConstants~MIN_LONG

::class 'MathConstants'
::constant PI 3.1
::constant MAX_LONG 2147483647
::constant MIN_LONG '-2147483648'

This is only a test
    4 *-* say 'The value of pi:' MathConstants~PI
Error 97 running E:\work.ooRexx\ooRexxUnit\qTest.rex line 4:  Object
method not found
Error 97.1:  Object "MATHCONSTANTS" does not understand message "PI"

In this case, you forgot the period on the class name.  It should be

say 'The value of pi:' .MathConstants~PI

Well, actually I expected this to work:

::constant PI 3.1
::constant MAX_LONG 2147483647
::constant MIN_LONG -2147483648'

Negative numbers are a little bit of a problem, one I've not got a satisfactory solution for implementing yet.  The value specified on the directive is restricted to a single constant symbol or literal string.  The value "-2147483648" is a constant symbol preceded by the "-" prefix operator.  I don't have a good mechanism for allowing expressions on the directive, so a negative value needs to be specified as a quoted string.  I'd like to fix that, and possibly allow some sort of expressions that would only be resolved once, but there are scoping and context issues that make this difficult.



But the syntax message says it has to be a string or a symbol.

   13 *-* ::constant MIN_LONG -2147483648
Error 19 running E:\work.ooRexx\ooRexxUnit\qTest.rex line 13:  String
or symbol expected
Error 19.916:  String or symbol expected as ::CONSTANT value

Any hints as to how to use ::constant?  <grin>

Mark Miesfeld

This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
Oorexx-devel mailing list