#A question about `context`

7 messages · Page 1 of 1 (latest)

covert oar
#

This is a simplified version of my code:
#{ let array = state("array", ()) let page-num = context here().page() context array.update(it => {it.push(page-num); it}) array.display() }
The result I expect is to add the page number of the current page to the array, that is:
(1,)
However, the actual result is:
(context(),)
Is there any way to make the context expression become an actual value?

smoky lava
#

move the context keyword to the first line

#

i.e. #context {

#

and remove it from everything inside

#

you cant write code that depends on some contextual value if that code isnt , itself, inside of context

#

so if you need something from context, all of your other stuff goes in there too

covert oar