quil-lang / quilc

The optimizing Quil compiler.
Apache License 2.0
457 stars 72 forks source link

ANON-GATE is risqué #662

Open stylewarning opened 4 years ago

stylewarning commented 4 years ago
QUIL> (anon-gate "BUG" (random-special-unitary 2) nil 0)
#<BUG-22 nil 0>

It takes nil to be a FORMAL whose name is nil. I think this would be a common error and should be eliminated.

ghost commented 3 years ago

I'm not sure I see why nil would be passed in in error. It does not seem to have any documented meaning. I do not think it's great to rule out the symbol name "nil". I suppose you could have a special rule that if you want that, you have to use :nil (nil in keyword package).