]Link as pub sub service.

APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !

]Link as pub sub service.

Postby tclviii-dyalog on Fri Nov 22, 2019 12:27 pm

Just saw the link video. (Yes at 7 a.m. in the morning)

One of the questioners asked if two interpreters could link to the same file, and would changes made by one interpreter be reflected to the file and then on to the second interpreter.

The answer was yes, but I got the sense that Adam was thinking about functions when he said yes.

Can I have one interpreter making changes to constant variables, and have those reflected into the second interpreter?

if the answer is yes, (and the value of the variablechanges in the second interpreter), would I have to write an explicit loop to check to see if the value changed? or could I set a trigger?

And secondarily, if I add a line to the bottom of a character matrix in a workspace, does the whole file get rewritten? Or does the link facility just append to the bottom of the file associated with the character matrix in the workspace?
Posts: 14
Joined: Tue Mar 02, 2010 6:04 pm

Re: ]Link as pub sub service.

Postby Morten|Dyalog on Sat Nov 23, 2019 9:15 am

Hi Tony!

Link is intended as a development time tool for synchronizing source code - which can include "constant arrays". It is not in any way designed as a mechanism for runtime use (except ]link.import to load code into the active workspace), so please DO NOT attempt to use it as a "pub sub service"!

If you do update a constant array and call ]link.add or ]link.fix to notify the system of the change, it WILL rewrite the entire array. If you commit the change to a source code management system like Git or SVN, they will typically only store the change, but they will have to read the entire old value to the entire new value to perform the "diff".
User avatar
Posts: 366
Joined: Tue Sep 09, 2008 3:52 pm

Return to APL Chat

Who is online

Users browsing this forum: No registered users and 1 guest