Have `?` fall back to stringObj.
Note that ->forward is not used once an Object is in the environment.
This commit is contained in:
parent
03d3247be3
commit
a2b0e0813b
|
@ -410,6 +410,14 @@ Object help(Object* params, int length, struct Environment* env)
|
|||
return text;
|
||||
}
|
||||
}
|
||||
Object* object = fetch(symbol, env);
|
||||
if (object) {
|
||||
size_t len;
|
||||
char* string = stringObj(object, &len);
|
||||
Object text = stringFromSlice(string, len);
|
||||
free(string);
|
||||
return text;
|
||||
}
|
||||
|
||||
return nullTerminated("Help not found!");
|
||||
}
|
||||
|
|
|
@ -106,7 +106,10 @@ struct Object {
|
|||
#endif
|
||||
};
|
||||
|
||||
Object* forward;
|
||||
union {
|
||||
Object* forward;
|
||||
char* docString;
|
||||
};
|
||||
};
|
||||
|
||||
struct StructDef {
|
||||
|
|
Loading…
Reference in New Issue