>>
APLDN Home

>>
Events

>>
Trainings

>>
APL Books

>>
APLDN Links

>>
Discussion Groups

>>
Downloads

>>
Articles

>>
Library

>>
Learning Tools

>>
APLDN User IO

>>
APL2000.com




Features

Author Thread: Syntactic Coloring (and Printing)
John.Estep
Syntactic Coloring (and Printing)
Posted: Sunday, March 12, 2006 2:26 PM (EST)

Question 1:

In version 3, one can set a (loud) color for "global names".  This includes both variables and functions.  Both are useful to avoid inadvertently using globals when one intended to use locals.  In version 5, however, it appears one can only set a color for global variables, and NOT for global functions.  If this is indeed the case, are there any plans to restore syntactic coloring for global functions?

 

Question 2:

Having become dependent on syntactic coloring, I look forward to each release hoping that we will finally be able to print function listings with syntactic coloring, rather than just being able to see the colors on the screen.  It is evidently not in version 5.  Is it possible for it to be included in version 6?  On the same subject, it would also be nice to be able to set margins for the printed page.


Comments:

Author Thread:
Support
Syntactic Coloring (and Printing)
Posted: Monday, March 13, 2006 1:40 PM (EST)

Re: Question 1

 

It would help clarify things if you were to give some concrete examples where you might expect syntax coloring to differentiate global names (vars and fns).

 

Re: Question 2

 

Your request to print with syntax coloring is on the list as a future enhancement.

APL2000 Support

     

John.Estep
Syntactic Coloring (and Printing)
Posted: Wednesday, March 15, 2006 9:18 AM (EST)

In version 3, one can set one color for a "Global name" and another for "Local name".  This applies to both functions and variables.  So, for example, if I have function <foo> in the workspace that calls global function <foosub>, when I edit <foo>, it shows all instances of <foosub> in red (the color I chose for global names).

 

However, if in function <foo2> I localize <foosub>, then any appearances of <foosub> in <foo2> appear in the editor in the color used for local--not global--names.

 

In version 5, however, there is no color choice for "Global name".  Instead the choice is for "Global variable".  This means there is no way to distinguish, by color, global functions from local functions.  In our application where we frequently localize and define functions within functions, and also frequently use global functions, this is a serious loss.

 

John Estep

     

Support
Syntactic Coloring (and Printing)
Posted: Wednesday, March 15, 2006 10:32 AM (EST)

Your request has been added to the list of future enhancements.

 

APL2000 Support

     

brent.hildebrand
Syntactic Coloring (and Printing)
Posted: Wednesday, March 15, 2006 11:23 AM (EST)

In V5, you have color capability for Global Variable, Local Variable, and User Function.  However, this is not exactly true.  Setting a unique color for Local Variable, will act more like a Local Name in that all local Variables and local Functions will take on the color of the Local Variable setting.  Global Variables can have a unique color as can Global User Functions, so these are always easy to distinguish.    Again, the Local Variable setting in V5 colors BOTH Local Variables and Local Functions.  

 

Conclusion - V5 has more color options than V3, nothing is lost.  You can always distinguish local "names" form global "names".  Globals can be further broken down to Variables and User Functions.   Local names, both variables and user functions, are colored by the Local Variable setting. 

 

If you are concerned when looking at a function that is down the stack during a suspension, then I don't know what happens, that would require testing to understand.  Perhaps coloring is defined by what []SINL shows?  ?

 

 

     

Paul.Ravitz
Syntactic Coloring (and Printing)
Posted: Wednesday, March 15, 2006 11:47 AM (EST)

I realize I'm piggy-backing on this thread, but I think this relates to what's being discussed here.

 

I had a discussion with Mark O. back in January 2004 about syntax coloring.  I mentioned that one can see, via different colors, the difference between an undefined global variable (the color for "Undefined Name") and a defined global variable (the color for "Global Variable").  But there isn't a way to tell the difference, color-­wise, between an undefined local variable and a defined one (they both use the color for "Local Variable").

 

During execution, it would be very useful to be able to visually distinguish between defined and undefined locals.  If I'm in the editor within an executing function, and I'm on or near a line with an undefined local (especially one in the middle of executing or about to be executed), I think a visual clue to that effect would trigger an almost subconscious response that something's possibly "wrong" (i.e. that there's a VALUE ERROR waiting to happen).  In fact, there may be times when, due to logic decisions, a particular statement might not execute THIS time, but might another time, but again, seeing the undefined local color might save me from a VALUE ERROR in the future (when the customer is running the code).

 

After some discussion, Mark responded that he thought he was convinced it would be useful, and that he would put it on his list for further session manager work.

 

I would still like to see this enhancement, which doesn't seem to be in the beta of version 6.0.  Any chance?

 

Also, he agreed that the color name "Local Variable" should more properly be called "Local Object", since it can either be a local variable OR a local function.

 

If you (APL2000 support) would like me to post the original E-mail train I had with Mark about this, let me know.

 

p

     

Support
Syntactic Coloring (and Printing)
Posted: Wednesday, March 15, 2006 2:22 PM (EST)

Paul,

 

Please forward a copy of your e-mail discussion with Mark to support@apl2000.com.

 

APL2000

     



APL2000 Official Web Site

When we try to pick out anything else in the Universe, we find it hitched to everything else in the Universe.
-- John Muir

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