Kind-colouring of dfns web pages

General APL language issues

Kind-colouring of dfns web pages

Postby JohnS|Dyalog on Wed Mar 02, 2016 1:33 pm

Following feedback on the Dyalog blog post: http://www.dyalog.com/blog/2015/05/name-colouring-for-dfns, as an experiment, names in the dfns sample code pages, on the Dyalog website, have been subtly "kind coloured". See for example: http://dfns.dyalog.com/c_display.htm.

Variable names (those that reference array values) are in normal font, while those that reference functions and operators are in italics. In addition, names of monadic and dyadic operators are coloured navy and purple, respectively.

This should make it easier to read code where adjacent names are of differing kinds. For example, in the expression
      lines print titles pages
we can now see that print is a dyadic function applied between left argument "lines" and a right argument, which is the pair of array values "titles" and "pages".

This first version of the kind-inferencing code http://dfns.dyalog.com/n_kk.htm is not perfect. In particular, it does a poor job with operand ⍺⍺. Parts of expressions where the inferencing fails are coloured red. With luck, a later version of kk should fix some of these shortcomings.

Feedback, comments, suggestions, etc: very welcome.

John
JohnS|Dyalog
 

Return to Language

Who is online

Users browsing this forum: No registered users and 1 guest