HTStruct constructor
HTStruct(
- HTInterpreter interpreter, {
- String? id,
- HTStruct? prototype,
- bool isPrototypeRoot = false,
- Map<
String, dynamic> ? fields, - HTNamespace? closure,
Implementation
HTStruct(this.interpreter,
{String? id,
this.prototype,
this.isPrototypeRoot = false,
Map<String, dynamic>? fields,
this.closure})
: id = id ??
'${InternalIdentifier.anonymousStruct}${structLiteralIndex++}',
_fields = fields ?? {} {
namespace = HTNamespace(
lexicon: interpreter.lexicon, id: this.id, closure: closure);
namespace.define(
interpreter.lexicon.kThis,
HTVariable(
id: interpreter.lexicon.kThis,
interpreter: interpreter,
value: this,
closure: namespace,
),
);
}