[m-users.] State variables

Zoltan Somogyi zoltan.somogyi at runbox.com
Sat Sep 18 07:16:53 AEST 2021


2021-09-18 07:04 GMT+10:00 "Sean Charles (emacstheviking)" <objitsu at gmail.com>:
> I guess what I am asking is, how do I start the process of, creating the state variable in scope,

Like this:

  some [!SV]
  (
     !:SV = ...,
     ...
     ... !.SV
  )

> the reference says that they have to be introduced into the head scope

I will fix that.

Note that there is another wrinkle in your example. If you want the graphics state
to be threaded through your code using di,uo argument pairs, then you cannot
wrap up the initial state in a maybe, because putting a unique value in a term
destroys its uniqueness. So in your place, instead of a returning yes(G), I would
return a yes() wrapped around something from which the initial G could be *computed*
as a unique value.

Zoltan.


More information about the users mailing list