Skip to content
Prev 36734 / 63424 Next

The parsing of '{' and a function that equal to '{'

On May 14, 2010, at 3:38 PM, thmsfuller066 at gmail.com wrote:

            
{ foo; bar } 

gets parsed into

`{`(foo, bar)

as you illustrated below. You can see that in the resulting expression:
{
    foo
    bar
}
@102182578 06 LANGSXP g0c0 [NAM(2)] 
  @10082c9b8 01 SYMSXP g0c0 [MARK,gp=0x4000] "{"
  @100edfaa0 01 SYMSXP g0c0 [] "foo"
  @100edfc98 01 SYMSXP g0c0 [] "bar"


and in case you are not familiar with the internal representation:
{
    foo
    bar
}
@100f99868 06 LANGSXP g0c0 [] 
  @10082c9b8 01 SYMSXP g0c0 [MARK,gp=0x4000] "{"
  @100edfaa0 01 SYMSXP g0c0 [] "foo"
  @100edfc98 01 SYMSXP g0c0 [] "bar"

Cheers,
Simon