>>
APLDN Home

>>
Events

>>
Trainings

>>
APL Books

>>
APLDN Links

>>
Discussion Groups

>>
Downloads

>>
Articles

>>
Library

>>
Learning Tools

>>
APLDN User IO

>>
APL2000.com




Bug Reports

Author Thread: []MOM problem with []FX
brent.hildebrand
[]MOM problem with []FX
Posted: Thursday, July 13, 2006 9:42 PM (EST)

There seems to be an issue with []MOM and []FX.  Observe the following sequence.  A function "Ave" is loaded in to the workspace,  "a" is defined, and a.Ave is defined.  The workspace is then saved.  Then the workspace is cleared, and the saved workspace is Copied back in.  "a" gets copied, and you can perform []CR on "a".  But if you try to execute the function, you get a VALUE ERROR on "x".  Huh?    BUT, if you create "a" and then "a.Ave", and execute a.Ave, then save the workspace.  Clear the workspace, and then copy "a" back into the workspace, everything is OK. 

 

 Here is the sequence that produces the failure:

      )clear
CLEAR WS
      ]uload Ave
1 object loaded
      Œvr 'Ave'
    ’ r„Ave x
[1]   r„(+/x)÷½,x
    ’
      Ave 2 3 4 5
3.5
      a„Œmom '' ''
      a.Œfx Œcr 'Ave'
Ave
      )wsid Test2
WAS CLEAR WS
      )save
C:\APLWIN60\TEST2 SAVED Thursday, July 13, 2006 06:27:40 PM
      )clear
CLEAR WS
      )copy Test2; a
SAVED Thursday, July 13, 2006 06:27:40 PM
      )vars
a
      a
<<<Object Reference>>>
      a.Œnl 2 3
Ave
      a.Œcr 'Ave'
r„Ave x
r„(+/x)÷½,x
      a.Ave 2 3 4 5
VALUE ERROR
Ave[1] r„(+/x)÷½,x
                 ^

 

Here is the sequence that works OK, but only because a.Ave was executed before the workspace was saved.

 

      )clear
CLEAR WS
      ]uload Ave
1 object loaded
      Œvr 'Ave'
    ’ r„Ave x
[1]   r„(+/x)÷½,x
    ’
      Ave 2 3 4 5
3.5
      a„Œmom '' ''
      a.Œfx Œcr 'Ave'
Ave
      a.Ave 2 3 4 5
3.5
      )wsid Test3
WAS CLEAR WS
      )save
C:\APLWIN60\TEST3 SAVED Thursday, July 13, 2006 06:29:34 PM
      )clear
CLEAR WS
      )copy Test3; a
SAVED Thursday, July 13, 2006 06:29:34 PM
      a.Œnl 2 3
Ave
      a.Ave 2 3 4 5 6 7 8
5

 

So you see what is difference in the above? 

 

Interesting, no? 

 

BH


Comments:

Author Thread:
davin.church
[]MOM problem with []FX
Posted: Thursday, July 13, 2006 10:42 PM (EST)
Does the interpreter still "semi-compile" code the first time it's executed?  Could that have anything to do with the strange behavior?

     

Support
[]MOM problem with []FX
Posted: Monday, July 17, 2006 10:07 AM (EST)

Thank you Brent for reporting this problem.  The problem is due to the symbol table not getting updated during the copy process.  The workaround is to define the function before executing it.  For example:  a.Œfx a.Œcr 'Ave'

APL2000 Support

 

     

     

brent.hildebrand
[]MOM problem with []FX
Posted: Monday, July 17, 2006 11:33 AM (EST)

The above solution indeed does resolve the problem.  But be aware of the situation is "x" is defined in the symbol, that the function might return an invalid or "non-result".  See the following:

 

      )clear
CLEAR WS
      )copy test2; a
SAVED Thursday, July 13, 2006 06:27:40 PM
      a.Ave 1 2 3
VALUE ERROR
Ave[1] r„(+/x)÷½,x
                 ^
      )reset
      x„1
      a.Ave 1 2 3
      a.Œfx a.Œcr 'Ave'
Ave
      a.Ave 1 2 3
2

 

So it might be best (for now) to []FX each function in an []MOM object.

 

BH

     

brent.hildebrand
[]MOM problem with []FX
Posted: Monday, July 17, 2006 12:58 PM (EST)

I left out an example where x is defined before or after copying the []MOM Object.

 

x defined after

      )clear
CLEAR WS
      )copy test2; a
SAVED Thursday, July 13, 2006 06:27:40 PM
      a.Œnl 2 3
Ave
      a.Ave 1 2 3 4 5
VALUE ERROR
Ave[1] r„(+/x)÷½,x
                 ^
      x„'char'
      a.Ave 1 2 3 4 5
DOMAIN ERROR
Ave[1] r„(+/x)÷½,x
          ^^
      x„ 4 5 6
      a.Ave 1 2 3
      a.Œfx a.Œcr 'Ave'
Ave
      a.Ave 1 2 3
2

x defined before

      )clear
CLEAR WS
      x„'char'
      )copy test2; a
SAVED Thursday, July 13, 2006 06:27:40 PM
      a.Ave 1 2 3
DOMAIN ERROR
Ave[1] r„(+/x)÷½,x
          ^^
      a.Œfx a.Œcr 'Ave'
Ave
      a.Ave 1 2 3
2
      x
char

     

brent.hildebrand
[]MOM problem with []FX
Posted: Monday, July 17, 2006 1:36 PM (EST)

When you said that the Symbol table was not updated, I tried the following experiment.  "a" in the workspace TEST3 worked O.K,  but not in TEST2. When copying from TEST3,  "x" and "r" do not get defined in the symbol table, even after the function has been run sucessfully.

 

      )clear
CLEAR WS
      )copy test3; a
SAVED Thursday, July 13, 2006 06:29:34 PM
      Œit 'SymbolTable'
   3 201 0 0 0
   a   1 0 0 0
 Ave   0 0 0 0
      a.Ave 2 3 4 5
3.5
      Œit 'SymbolTable'
   3 201 0 0 0
   a   1 0 0 0
 Ave   0 0 0 0

      a.Œfx a.Œcr 'Ave'
Ave
      Œit 'SymbolTable'
   5 201 0 0 0
   a   1 0 0 0
 Ave   0 0 0 0
   r   0 0 0 0
   x   0 0 0 0
      a.Ave 4 5 6 7
5.5

 

In TEST2 is another story.  "r" and "x" do get defined.  But the function does not run sucessfully.  And in fact, the interpreter can now be crashed. 

      )clear
CLEAR WS
      )copy test2; a
SAVED Thursday, July 13, 2006 06:27:40 PM
      Œit 'SymbolTable'
   3 201 0 0 0
   a   1 0 0 0
 Ave   0 0 0 0
      a.Ave 2 3 4 5
VALUE ERROR
Ave[1] r„(+/x)÷½,x
                 ^
      ©©© do not check Œit 'SymbolTable'
      ©©© the interpreter will crash.
      )reset
      Œit 'SymbolTable'
   5 201 0 0 0
   a   1 0 0 0
 Ave   0 0 0 0
   r   0 0 0 0
   x   0 0 0 0
      ©©© but Ave still does not work
      a.Ave 2 3 4 5
VALUE ERROR
Ave[1] r„(+/x)÷½,x
                 ^
      )reset
      a.Œfx a.Œcr 'Ave'
Ave
      a.Ave 2 3 4 5
3.5

 

It is interesting that the Symbol table does not show "r" and "x" in the TEST3 example, even though the function works OK. 

 

So, when will we be able to put Objects into Objects??   a.b.Ave ??   <g>

 

 

     

Michael.Shumate
[]MOM problem with []FX
Posted: Tuesday, July 18, 2006 2:51 PM (EST)

 

Couple of comments.

 

1) the []fx isn't documented in 6.2 Help. Will more help with MOM be forthcoming?

 

2) A facility to view the contents of a MOM would be helpful.

 

Such as:

 

[]MView 'MOMobject'

===================

[]MOM 'MOMobject'

-----------------------------

.obj1

8640946

------------------------------

.obj2

'This is the contents of .obj2'

------------------------------

.[]fx

<Create_Fire[]

[1].....

-------------------------------

 

etc.

 

Any possibility?

 

Thanks,

 

/mas

 

 

     

Michael.Shumate
[]MOM problem with []FX
Posted: Tuesday, July 18, 2006 3:02 PM (EST)

More thoughts.

 

Also, there doesn't seem to be a way to edit a function once stored in a MOM.

 

[]cr cc.Calc_Stuff obviously doesn't work, but then neither does

[]cr 'cc.Calc_Stuff'.

 

)edit cc.Calc_Stuff doesn't work.

 

So you end up having to keep a separate copy of the function for editing and updating. Doesn't that defeat the purpose of MOM?

 

There needs to be a way to extract the function from the MOM for editing.

 

Thanks again,

 

/mas

 

     

brent.hildebrand
[]MOM problem with []FX
Posted: Tuesday, July 18, 2006 3:07 PM (EST)

[1]  []FX is documented in the v6.2 update.  That is how I learned of it.

[2] MOMobj.[]NL 2 3  will list all variables and functions.

 

It might be nice to have something like:

[]NS <-- MOMobj    or   []OSELF <-- 'MOMobj', or  []MSELF,

[]MOMSELF or ...

Then,   )fns and )var work, but only show the functions and variables in MOMobj.    ;-)

 

 

 

     

Support
[]MOM problem with []FX
Posted: Tuesday, July 18, 2006 3:21 PM (EST)

> There needs to be a way to extract the function from the MOM for editing.

This is possible.  Here's an example:

     a.Œnl 3  © list functions

Ave
     Œdef a.Œcr 'Ave'  © define function
Ave
     )fns
Ave

APL2000 Support

     

Michael.Shumate
[]MOM problem with []FX
Posted: Tuesday, July 18, 2006 3:42 PM (EST)

Thanks, that helps.

 

I also noticed that the new inflate/deflate functionality of []dr has a problem with MOM objects:

 

 z„ 'This includes a MOM object (cc)' cc '6444' 54654
      r„'deflate' Œdr z

      'inflate' Œdr r
DOMAIN ERROR
      'inflate' Œdr r
                ^
      x„'inflate' Œdr r
DOMAIN ERROR
      x„'inflate' Œdr r
                  ^
So it will deflate an object containing a MOM but it won't inflate the result.

 

Thanks,

 

/mas

     

Support
[]MOM problem with []FX
Posted: Tuesday, July 18, 2006 5:13 PM (EST)

> 1) the []fx isn't documented in 6.2 Help.

 

The reason for this is that no new help files were released with the 6.2 update.  However, new help files and manuals will be released with the release of the version 6.2 full system installer, which should be available within a week.  We will also make these help files and manuals available as a separate download.

APL2000 Support

     

davin.church
[]MOM problem with []FX
Posted: Tuesday, July 18, 2006 5:46 PM (EST)
That sounds good to me! Dyalog has a similar facility for working in namespaces, using )CS to "change space", effectively switching to a sub-workspace. I think that the ability to logistically switch to a different environment to work in would be quite valuable.

     

Support
[]MOM problem with []FX
Posted: Wednesday, July 19, 2006 5:48 PM (EST)
We are looking into the problem reported with inflating an array containing a MOM object with ŒDR.

APL2000 Support

     

Support
[]MOM problem with []FX
Posted: Thursday, September 14, 2006 10:01 AM (EST)

This bug will be fixed in version 6.4, which will be released later this month.  In the interim, you can download and test the fix in the version 6.4 beta available at http://apldn.apl2000.com/downloads/APLWI+Downloads/APLWIB6/default.aspx.

 

Thank you for your patience.

 

Note:  Version 6.4 and beta are only available to APL+Win 6 APLDN subscription licensees.

     

Support
[]MOM problem with []FX
Posted: Thursday, September 14, 2006 10:01 AM (EST)

This bug will be fixed in version 6.4, which will be released later this month.  In the interim, you can download and test the fix in the version 6.4 beta available at http://apldn.apl2000.com/downloads/APLWI+Downloads/APLWIB6/default.aspx.

 

Thank you for your patience.

 

Note:  Version 6.4 and beta are only available to APL+Win 6 APLDN subscription licensees.

     



APL2000 Official Web Site

Love sought is good, but given unsought is better.
--- Shakespeare

APLDN Home   |    |  Events   |  Trainings   |  APL Books   |  APLDN Links   |    |  Discussion Groups   |    |  Downloads   |  Articles   |  Library   |  Learning Tools   |  APLDN User IO   |  APL2000.com   |