Hi,

just an experiment to see what can be done ...

Works like a charm - mostly :-)

⍝ ------------------- an arbitrary function.
      ∇example[⎕]
    ∇
[0]   Z←example name_struct
[1]   Z← name_struct
[2]   Z.N ← 'new'
[3]   ⎕EX 'Z.K'
    ∇

⍝ ----------------- some data
      A.B.C.D ← 14
      A.B.C.K ← 20

⍝ ---------------- content of a
      A
.B:
.B.C:
.B.C.D: 14

.B.C.K: 20

⍝ ----------------- experiment
      example A.B.C
1   ⍝ ⎕EX

⍝ returned by Z:
.D: 14

.N: ┌→──┐    ⍝ line [2]
    │new│
    └───┘

⍝ ----------------- even this can be done
      V ← example A.B.C
1 ⍝ ⎕EX

      V ≡ example A.B.C
1 ⍝ ⎕EX
1 ⍝ ≡


⍝ ---------------- here comes the bug:
      ∇example[⎕]∇
    ∇
[0]   Z←example name_struct
[1]   Z← name_struct
[2]   Z.N ←'new'
[3]   ⎕EX 'Z.K'
[4]   Z.K ← 'NEW'

⍝ added line [4]

     example A.B.C
1 ⍝ ⎕EX
SYNTAX ERROR
example[3]  Z.K←'NEW'
               ^
      Z.K←'NEW' ⍝ does it immediately after syntax error
      →3        ⍝ repeat from ⎕EX on
1 ⍝ ⎕EX

⍝ returned by Z:
.D: 14

.K: ┌→──┐
    │NEW│
    └───┘

.N: ┌→──┐
    │new│
    └───┘

Best Regards
Hans-Peter

Reply via email to