In graduate school, perhaps 1989 or so, one of our bigger homeworks was to 
implement a variable trap mechanism for assignments and for dereferences. I 
believe the variable trap notion originated in one of the SNOBOL dialects, or 
in SL5. From the 1989 class, there were about a dozen independent 
implementations performed... on Icon version 7 or so.  I do not know whether 
any of them could ever be found. One thing that I remember is: it is harder 
when you have to trap assignments to variables like L[i][j] or T[s] or r.x and 
not just simple variables.


I know that I have wanted it pretty badly, though: variable traps are needed in 
the udb debugger, to make a more efficient watch facility.  Logically, it is 
needed as part of the execution monitoring facilities.


So I propose a tweak to Bruce's question: *aside from debugging*, what uses can 
you think of, for catching all assignments to a particular variable?

Cheers,

Clint


________________________________
From: Bruce & Breeanna Rennie <bren...@dcsi.net.au>
Sent: Sunday, January 22, 2017 1:44:46 PM
To: Unicon group
Subject: [Unicon-group] Trapped variable processing and extending this facility 
to other user defined variables

Greetings to all,

Thanks to Clinton and Don Ward, we now have the new Unicon/Icon
Implementation Book available within the sourceforge download.

As I have been away from internet access, I have been reading the
current book as a evening activity. The section on trapped variables has
given rise to a question as follows.

Is there a use for or a need for this ability to associate a function
that can run when a value is assigned to a specific variable?

For example, in Unicon, one is allowed to define a default type and
value for procedure parameters. Is this a valid situation in which any
such variables could be created as trapped variable using a new system
defined function to make this a user define d trapped variable?

Are there other situations where such a facility could be useful?

regards

Bruce Rennie

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to