Question

I was trying this language and I have a question with this code:

cocurrent'local1' 
text1=: 'CCC'
cocurrent'local2'
text1=: 'AAA'

f0=: 3 : 0
  select. y
     case. 1   do. text1
     case. 2   do. cocurrent'local1', 'change'
  end.
)

f0 &.> 1 2 1
┌───┬┬───┐
│AAA││AAA│
└───┴┴───┘

As you can see, the "change" word never came up, but I call f0 with 2 so the change never happened.

What's going on here?

Was it helpful?

Solution

In case 2, you're setting your locale to 'local1change', because 'local1', 'change' concatenates the strings to 'local1change'.

Also, your last cocurrent before f0 is local2, which means f0 is inside local2. You're never leaving local2. I'm not sure why your last 'AAA' happends though, but know that you should set your current locale with cocurrent 'base' (or wherever you started declaring those locales from) before declaring f0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top