the-carlisle-group / Acre-Desktop

A simple Dyalog APL IDE plugin that introduces "projects" and allows you to keep your source code in Unicode text files.
MIT License
11 stars 1 forks source link

CreateProject with modifier -variables=binary fails to write out variables with numeric value "0" #240

Open JoshDavid opened 1 year ago

JoshDavid commented 1 year ago

Interestingly, this option fails when you have variables containing the numeric value of 0. Variables of 0 get written out with the variables=on switch just fine.

Tested in 8.3.1+432 and 8.3.0+340:

  ]acre.version

Acre 8.3.1+342 2022-03-15 22.49

  a ← 0 
  b ← 1 
  c ← ⍳10

  ]acre.CreateProject C:\tmp\at1 # -variables=binary

# )CLEAR clear ws

  ]acre.OpenProject C:\tmp\at1

Please wait - Reading 3 files from C:/tmp/at1 .binary #.b fixed as .apla #.b .binary #.c fixed as .apla #.c # )VARS b c

a never made it to disk!

Looks like the problem is in acre._code.createProject[24] fqn←⊃dat putSource raw getValue fqn If we look at the first result of getValue, when we give a left arg of 1 (means raw), a is not returned.

   ⊃1 getValue fqn

.b #.c #.quadVars

   ⊃0 getValue fqn

.a #.b #.c #.quadVars