_hyperscript icon indicating copy to clipboard operation
_hyperscript copied to clipboard

[Bug] "element ElementVariable" and ":ElementVariable" differ

Open rozek opened this issue 3 years ago • 2 comments

The following code

<div _='
  init
    set element ElementVariable to `element variable w/o :`
    set :ElementVariable to `element variable w/ :`

    if (element ElementVariable == :ElementVariable)
      put `"element ElementVariable" is equivalent to ":ElementVariable"` into #ElementOutput
    else
      put `"element ElementVariable" differs from ":ElementVariable"` into #ElementOutput
    end
  end
'></div>
<div id="ElementOutput"></div>

shows that element ElementVariable and :ElementVariable refer to different variables

A live example can be found here

rozek avatar Jul 27 '22 09:07 rozek

The sigil is part of the name. It seems this was never documented as clearly as it should have

dz4k avatar Aug 03 '22 10:08 dz4k

Indeed, that's very important - and not really intuitive (not for me, at least)

rozek avatar Aug 03 '22 10:08 rozek