System/Interpreter/Requests/Implemented

From J Wiki
Jump to navigation Jump to search
Requests: Interpreter   Bugs: Interpreter

Please restrict the headings to just two levels, with the actual bug reports placed at the top level; sign your submission using ~~~~; register the entry in the comment field below.


The following requests for interpreter changes have been implemented in the JE.



Allow a modifier to look inside the calling frame

There should be syntax to look into the caller's stack frame to evaluate a name, especially an argument to a modifier. Currently local verb-names cannot be passed into modifiers.

Implemented by u./v.

Henry Rich (talk) 13:15, 12 June 2017 (UTC)

Dereference locale reference in object locative when the verb is passed into modifier

A verb operand is passed into modifier by name "one-to-one". For object locatives it has the form myVerbName__myLocPtr . That is, myLocPtr noun is not evaluated to its value (myLoc). Possibly it should, to conform Dictionary fully. If the callee has received the dereferenced name in explicit locative form (myVerbName_myLoc_), this would keep track of a vital information from caller.

Implemented by u./v.

Igor Zhuravlov (talk) 00:09, 9 October 2017 (UTC)

Allow ;. to operate on empty array

   2 ];.0 i. 2
0 1                  NB. ok
   2 ];.0 i. 1
0                    NB. ok
   2 ];.0 i. 0
|index error         NB. should be: i. 0
| 2 ];.0 i.0       
   2 ];.0 i. 0 0
|index error         NB. should be: i. 0 0
|   2    ];.0 i.0 0
   2 2 ];.0 i. 0 0
|index error         NB. should be: i. 0 0
|   2 2    ];.0 i.0 0
   2 ];.0 i. 0 2
|index error         NB. should be: i. 0 2
|   2    ];.0 i.0 2
   2 2 ];.0 i. 0 3
|index error         NB. should be: i. 0 2
|   2 2    ];.0 i.0 3

Originally reported in Jprogramming forum.

Implemented 12/30/2018

Igor Zhuravlov (talk) 04:38, 30 December 2018 (UTC)


make 0 {:: scalar not a length error

0 {:: y c/should return y if y is a scalar. Currently a length error. (<0) { scalar could do same (return the scalar). The value would be fewer errors, and also handling errors with {:: with the assumption that it is an index error, that makes an "upsert" function possible.

Implemented ({::). { will not be changed.

Pascal Jasmin (talk) 02:28, 19 September 2018 (UTC)

Add optional left arg to 0!:n

This new x argument (a string) would be be added to the list in 4!:3 (if not already there), and the new index in that 4!:3 list would be the result of 4!:4 for definitions created by the 0!:n call.

This is needed, as the main case, to preprocess files without creating new temporary files to pass to the load function. Temporary files interfere with some of the parallel J features (zeromq) being implemented and may need to be permanent if there is a use of 4!:4 that requires/assumes the file still exist. The main, prejudged (innapropriately) as possibly the only real, use case for 4!:4 is to find the directory of its own script.

Esoteric uses may include "arbitrary labelling" of 4!:4 return values from noun scripts, or otherwise disguising the file source definitions.

Status: The desired functionality is added via 4!:6 and 4!:7.

Pascal Jasmin (talk) 19:23, 24 August 2018 (UTC)