rljacobson / FoxySheep

Compiler Technologies for Mathematica/Wolfram Language.
BSD 2-Clause "Simplified" License
36 stars 3 forks source link

Parse ? and ?? #5

Open rocky opened 3 years ago

rocky commented 3 years ago

Shouldn't these get converted to Information[]?

rljacobson commented 3 years ago

They are tricky, because they are evaluated in a nonstandard and inconsistent way in Mathematica. I and other Mathematica syntax experts I have spoken with are inclined to treat them as not part of the language proper. Rather, they are an interface to the UI.

Officially, ? and ?? are only supposed to be used at the beginning of a line, a syntactic requirement unique to those two sigils. If you treat them as Information[], I would relax that requirement. Just make sure you consider what consequences there are, if any, when you use them inside another expression rather than at the beginning of a line.