55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
return nullopt;
}
return TVEC( TERM( make_shared< Vector >( vt.persistent(), false ) ),
*rtSig );
}
optional< Value > BuildTFunc( const Context& c, const StringId& id, const Value& returnType, const Value& params, vector< Term >&& body )
{
auto funcType = BuildTFuncType( returnType, params );
auto sig = BuildTFuncSignature( c, funcType );
if( !sig )
return nullopt;
auto pToks = make_shared< vector< Term > >( move( body ) );
return ToValue( TFunc( move( funcType ),
*sig,
AppendToVectorTerm( c.identity(), TERM( id ) ),
move( pToks ) ) );
}
optional< Term > BuildArgPatternFromTFuncType( const Context& c, const Value& tfuncType )
{
const auto& ftype = FromValue< TFuncType >( tfuncType );
assert( ftype );
|
|
<
|
<
<
<
|
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
return nullopt;
}
return TVEC( TERM( make_shared< Vector >( vt.persistent(), false ) ),
*rtSig );
}
optional< Value > BuildTFunc( const Context& c, const Term& identity, const Value& returnType, const Value& params, vector< Term >&& body )
{
auto funcType = BuildTFuncType( returnType, params );
auto sig = BuildTFuncSignature( c, funcType );
if( !sig )
return nullopt;
auto pToks = make_shared< vector< Term > >( move( body ) );
return ToValue( TFunc( move( funcType ), *sig, identity, move( pToks ) ) );
}
optional< Term > BuildArgPatternFromTFuncType( const Context& c, const Value& tfuncType )
{
const auto& ftype = FromValue< TFuncType >( tfuncType );
assert( ftype );
|