Snap icon indicating copy to clipboard operation
Snap copied to clipboard

block-joining a variable with a list as the name results in an unsplittable ring

Open 1e1001 opened this issue 3 years ago • 1 comments

I'm doing some weird macro things and encountered this, I think it's not stringifying the variable name until it's evaluated or displayed.

Constructing the variable in the normal way

(join {ring ()} "var") -> {ring (var)} (call {ring (var)}") -> value of "var" (split {ring (var)} by blocks) -> (list {ring ()} "var")

Constructing the variable using a list object

(join {ring ()} (list 0)) -> {ring (a List [1 elements])} (call {ring (a List [1 elements])}) -> value of "a List [1 elements]" (split {ring (a List [1 elements])} by blocks) -> TypeError: indices.isEmpty is not a function

I also noticed that if I stored the result of the join in a variable Snap! would sometimes freeze when it would be accessed.

1e1001 avatar May 20 '22 15:05 1e1001

This is almost certainly related to my bug report that you can get an unringified block in pure Snap!, as you are using the same mechanism. I suspect this would be fixed if that were.

WarpedWartWars avatar May 21 '22 03:05 WarpedWartWars