Rick,

You know I did a little investigation, using a sort of reflexion and
discovered that.  It is quite cool.

  src = .array~new
  src[1] = "::routine speak public"
  src[2] = "use strict arg w = 'Hello World'"
  src[3] = "say w"
  src[4] = "return 0"

  obj = .Package~new("test", src)

  itr = .Package~methods
  do while itr~available
    say 'isPrivate:' itr~item~isPrivate
    itr~next
  end

   rt = obj~publicRoutines

   say 'rt:' rt

   do i over rt
     say i
   end

   rtObj = rt["SPEAK"]
   say 'rtObj' rtObj

  itr = rtObj~class~methods
  do while itr~available
    say 'Method:' itr~index
    mthObj = itr~item
    say 'isPrivate:' mthObj~isPrivate
    itr~next
  end

  --rtObj~callWith(.array~of("hello"))
  rtObj~call
  do l over rtObj~source
    say l
  end

--
Mark Miesfeld

On Tue, Jul 1, 2008 at 3:15 PM, Rick McGuire <[EMAIL PROTECTED]> wrote:
> Realized I didn't answer all of your questions.  The other new class
> is the Routine class, which decouples Routines from Methods.
> Previously, a ::ROUTINE directive created a Method object....now it
> creates a Routine object.  You could also have generated the parser
> errors using a Routine object in the same way.  One nice thing about
> Routine instances is they are callable using either
>
>    result = r~call(a,b,c)
>
> or
>
>   result = r~callwith(.array~of(a,b,c))
>
> Rick
>
> On Tue, Jul 1, 2008 at 4:40 PM, Mark Miesfeld <[EMAIL PROTECTED]> wrote:
>> On Tue, Jul 1, 2008 at 11:29 AM, Rick McGuire <[EMAIL PROTECTED]> wrote:
>>
>>> I was looking at what you've done for processing syntax errors in the
>>> CONSTANT directive test group, and I have some suggestions that might
>>> make these types of tests easier to manage.  To start with, you can
>>> completely eliminate the need to write this to a file by using the new
>>> package class.  For example,
>>>
>>>    src = .array~new
>>>    src[1] = "return 0"
>>>    src[2] = ""
>>>    src[3] = "::class 'TestClass'"
>>>    src[4] = "::constant PI 3.14195"
>>>    src[5] = "::constant ZERO 0.0"
>>>    src[6] = "::constant PI 3.14195"
>>
>> Will that looks good.  Even though I saw the C++ PackageManager and
>> PackageClass while stepping through things in the debugger, I didn't
>> realize a new class had been added to what is available in Rexx code.
>>
>> Are there any others?
>>
>>
>>>    p = .package~new("test", src)
>>
>> I like this a little better
>>
>> ::method test_x
>>  <src creation>
>>
>>  self~expectSyntax(99.932)
>>  p = .package~new("test", src)
>>
>>> Also, it might be nice if this could be incorporated as part of the
>>> base infrastructure:
>>>
>>>   self~assertSyntaxError(99.932, src)
>>
>> Then this, I think
>>
>> ::method test_x
>>  <src creation>
>>
>>  self~assertSyntaxError(99.932, src)
>>
>> because the second will raise the syntax error within the
>> ooRexxUnit.cls file.  I think, have to look at that code again.  If it
>> does, we would loose some of the info on where the real error was.
>>
>> --
>> Mark Miesfeld
>>
>> -------------------------------------------------------------------------
>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>> Studies have shown that voting for your favorite open source project,
>> along with a healthy diet, reduces your potential for chronic lameness
>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>> _______________________________________________
>> Oorexx-devel mailing list
>> Oorexx-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>>
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to