Goose  Diff

Differences From Artifact [d2fecb3120]:

  • File bs/sema/inv-func.cpp — part of check-in [b844506db4] at 2019-01-30 22:39:09 on branch trunk — First draft of the compile-time interpreter. A simple builtin function call works. (user: achavasse size: 3093)

To Artifact [76039e6b56]:

  • File bs/sema/inv-func.cpp — part of check-in [2b052e7af9] at 2019-01-30 23:31:17 on branch trunk —
    • Moved all the high level setup (of env, resolver, parser etc) into a Compiler class, along with general purpose builtin functions (Print() and Args())
    • Fixed unification of empty vectors.
    • Fixed a couple of issues with builtin functions wrapping.
    (user: achavasse size: 3051)

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
                    cout << "function arguments mismatch.\n";
                    return nullopt;
                }

                auto unifiedArgs = ValueFromIRExpr( Substitute( *bestSol, *bestUC ) );
                assert( unifiedArgs );

                // TODO: reduce the value
                return Value( rtype, make_shared< llr::Element >( llr::Call( callee, *unifiedArgs ) ) );
            }

            virtual Term getSignature( const ptr< Env >& env, const Value& callee ) const override
            {
                return getSignatureAndRType( env, callee ).first;
            }







<







44
45
46
47
48
49
50

51
52
53
54
55
56
57
                    cout << "function arguments mismatch.\n";
                    return nullopt;
                }

                auto unifiedArgs = ValueFromIRExpr( Substitute( *bestSol, *bestUC ) );
                assert( unifiedArgs );


                return Value( rtype, make_shared< llr::Element >( llr::Call( callee, *unifiedArgs ) ) );
            }

            virtual Term getSignature( const ptr< Env >& env, const Value& callee ) const override
            {
                return getSignatureAndRType( env, callee ).first;
            }