Vocabulary/ObsoleteSyntax

From J Wiki
Jump to navigation Jump to search

Back to: Vocabulary

Obsolete Syntax

As J has developed, language features have been added and discarded. Older reference works may have example code that ran on earlier J versions but not on the latest releases. This page will help you to translate Old J to Modern J.

Deleted Primitives

Old J had primitives that have been deleted from Modern J:

  • Even and Odd (.. and .:)
  • Support for calculus (d. D. D:) - the functions of these primitives are provided by the math/calculus addon
  • Support for Maclaurin series (t. t: T.)

x. y. u. v. m. n.

In early J, the arguments x y etc. were treated as control words, ending with a period. To conform to modern J usage, remove the trailing period.

Decorated constants

In Old J, any constant was automatically demoted to the smallest type that accurately contained the value. Thus, 0, 00, and 0. all represented the same value, the boolean 0. In Modern J these constants have different precisions.

Direct Definitions {{ }}

In Old J the only way to create an explicit definition was with the : conjunction, in the forms 3 : 0 or n : 'definition' or the equivalent verb define. In Modern J {{ }} can be used to create definitions, largely superseding the older method.