Goose  Diff

Differences From Artifact [773b788b99]:

  • File bs/builtins/statements/using.cpp — part of check-in [a742f106d4] at 2019-03-23 13:08:49 on branch trunk —
    • ir: terms can now contain a pointer to another term, for situations where a mutable terms needs to be shared by multiple expressions.
    • func: use a term pointer to store the function's content, so that we can distinguish a not-yet-parsed function from a non evaluated function value.
    (user: achavasse size: 4654)

To Artifact [7f0d5c8e08]:

  • File bs/builtins/statements/using.cpp — part of check-in [61b4955ba0] at 2019-03-23 14:04:07 on branch trunk — ir: made it possible to use anonymous ANYTERM patterns in matching. (user: achavasse size: 4654)

107
108
109
110
111
112
113
114

115
116
117
118
119
120
121
122
123

124
125
107
108
109
110
111
112
113

114
115
116
117
118
119
120
121
122

123
124
125







-
+








-
+


                    content = ValueToIRExpr( *result );
                }

                result = get< Term >( content );
                return Env::Status::Success;
            };

            context.env()->storeValue( localIdentity, ANYTERM( c ),
            context.env()->storeValue( localIdentity, ANYTERM( _ ),
                make_shared< Env::ValueProvider >( move( UsingValProvider ) ) );

            return true;
        };

        Rule r( handleUsing );
        auto ruleVal = ToValue( move( r ) );
        auto ruleTerm = ValueToIRExpr( ruleVal );
        e.storeValue( TVEC( TSID( e0 ), TSID( using ) ), ANYTERM( x ), ruleTerm );
        e.storeValue( TVEC( TSID( e0 ), TSID( using ) ), ANYTERM( _ ), ruleTerm );
    }
}