>>
APLDN Home

>>
Events

>>
Trainings

>>
APL Books

>>
APLDN Links

>>
Discussion Groups

>>
Downloads

>>
Articles

>>
Library

>>
Learning Tools

>>
APLDN User IO

>>
APL2000.com




Bug Reports

Author Thread: binding rules
Nicolai.Ohm
binding rules
Posted: Friday, July 15, 2005 6:50 AM (EST)

A small inconsistency in binding rules:

The following statement generates an EVOLUTION ERROR

 

      (A B C)„¼3
      A B C[2]
EVOLUTION ERROR
      A B C[2]
      ^    ^

while the following equivalent statement does not:

 

      1 2 3­A B C
1
      1 2 3[2]
2


Comments:

Author Thread:
j.merrill
binding rules
Posted: Friday, July 15, 2005 10:12 AM (EST)
For those reading this thread, paste Nicolai's code into APL to see what it really looks like.  (The rendition in the browser that I see is quite silly.  Part of the problem is that the font is so small that the brackets look like stile chars.)
 
Those are not equivalent (as you can see from the error in one case and not the other).  The text
   1 2 3
is a constant (numeric) vector, just like the expression
    'ABC'
is a constant vector (this time character).  The text
    A B C
is an expression.  An expression cannot be indexed (or assigned) unless it is parenthesized.

     

William.Rutiser
binding rules
Posted: Friday, July 15, 2005 11:05 AM (EST)
EVOLUTION ERROR is given in several awkward cases where the STSC and IBM APL definitions once diverged. In this case, it has to do with the left scope of the indexing brackets. One arguable definition would treat A B C[2] as A B (C[2]) while another would treat it as ( A B C )[2]. This error was added to trap old code that depends on either definition. Add a pair of parens to make your intent clear to the interpreter as well as other programmers.

     



APL2000 Official Web Site

Service is the rent we pay for being. It is the very purpose of life, and not something you do in your spare time.
--- Marion Wright Edelman

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