HTStruct constructor
HTStruct(
- HTInterpreter interpreter, {
- String? id,
- HTStruct? prototype,
- bool isRootPrototype = false,
- Map<
String, dynamic> ? fields, - HTNamespace? closure,
Implementation
HTStruct(this.interpreter,
{String? id,
this.prototype,
this.isRootPrototype = 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, value: this));
}