diff options
| author | Mistivia <i@mistivia.com> | 2025-07-01 19:14:09 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-07-01 19:14:09 +0800 |
| commit | aec1c5667b130d40c86403037bb16463f77db7bb (patch) | |
| tree | 5b43e82fe5a4e4fe086947fcf3f793a2cebda906 /src/sexp.c | |
| parent | 10b2b4d98d9a96890779007e4e574bb4471f1031 (diff) | |
use pointer instead of handler in gc
Diffstat (limited to 'src/sexp.c')
| -rw-r--r-- | src/sexp.c | 26 |
1 files changed, 4 insertions, 22 deletions
@@ -3,28 +3,10 @@ #include <inttypes.h> -void SExpRef_show(SExpRef self, FILE* fp) { } - -void SExp_show(SExp self, FILE* fp) { - if (self.type == kEmptySExp) fprintf(fp, "<EMPTY>"); - else if (self.type == kIntegerSExp) fprintf(fp, "%"PRId64, self.integer); - else if (self.type == kRealSExp) fprintf(fp, "%lf", self.real); - else if (self.type == kBooleanSExp) { - if (self.boolean) fprintf(fp, "#t"); - else fprintf(fp, "#f"); - } else if (self.type == kNilSExp) fprintf(fp, "()"); - else if (self.type == kCharSExp) fprintf(fp, "#\\%c", self.character); - else if (self.type == kStringSExp) fprintf(fp, "\"%s\"", self.str); - else if (self.type == kSymbolSExp) fprintf(fp, "'%s", self.str); - else if (self.type == kUserDataSExp) fprintf(fp, "<%p>", self.userdata); - else if (self.type == kFuncSExp) fprintf(fp, "<FUNCTION>"); - else if (self.type == kPairSExp) { - fprintf(fp, "(<%d> . <%d>)", self.pair.car.idx, self.pair.cdr.idx); - } - else if (self.type == kEnvSExp) fprintf(fp, "<Env>"); - else if (self.type == kBindingSExp) fprintf(fp, "<BINDING>"); - else if (self.type == kMacroSExp) fprintf(fp, "<MACRO>"); -} +void SExpRef_show(SExpRef self, FILE* fp) {} +void SExpPtr_show(SExpPtr self, FILE* fp) {} +void SExp_show(SExp self, FILE* fp) {} VECTOR_IMPL(SExp); VECTOR_IMPL(SExpRef); +VECTOR_IMPL(SExpPtr); |
