Parser question - tilda binary operator

141 views
Skip to first unread message

Michael Francis

unread,
Feb 26, 2015, 2:30:34 PM2/26/15
to juli...@googlegroups.com
The tilda (~) binary operator is special cased in julia_parser.scm (line 552) to :(@~ <lhs> <rhs>) what is the special case used for ? 
There is no macro defined for ~ so this just reports "@~ not defined"

Is this something which should be removed from the parser? 

Stefan Karpinski

unread,
Feb 26, 2015, 2:59:28 PM2/26/15
to juli...@googlegroups.com
This is used in various stats packages to construct formula objects a la R:


It's not defined by default because Base doesn't provide any meaning for it.

Michael Francis

unread,
Feb 26, 2015, 4:20:41 PM2/26/15
to juli...@googlegroups.com
Out of interest why is that a macro and not a standard operator ? 

Stefan Karpinski

unread,
Feb 26, 2015, 4:53:12 PM2/26/15
to juli...@googlegroups.com
To make formulas work, you need access to the AST, not just two values, so it has to be.

Ivar Nesje

unread,
Feb 26, 2015, 5:08:32 PM2/26/15
to juli...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages