Gauche > Archives > 2024/05/15

2024/05/15 00:27:34 UTCshiro
#
About let-syntax: there's a limitation of the forms that can come rhs of define-syntax; it must be either a syntax-rules form, an er-macro-transformer form, or a macro/syntax keyword. Your example is invalid, merely not error-checked (maybe I should). https://practical-scheme.net/gauche/man/gauche-refe-draft/Hygienic-macros.html#Hygienic-macros
#
SRFI-147 allows you to have local definitions within a transformer spec: https://srfi.schemers.org/srfi-147/
#
Gauche hasn't supported SRFI-147 yet, though. I think I attempted once and there was some corner cases that hygiene didn't work well. I forgot the details.
#
Regarding hash-table content, yes, it's nice that REPL can print its content. You can't override printing output of built-in objects with write-object; that's by design. I put off implementing the content printing b/c (1) we didn't have pprint, and printing content of a hash table would potentially produce huge output, and (2) a hash table can have arbitrary comparator and that can't be serialized.
#
Now that we have pprint, so (1) isn't an issue any longer. We can also workaround (2) by priting comparator as unreadable object.
#
(Actually, you can see there's a code that print hashtable contents, but it is currently #ifdef-ed out).
#
I'll track hash-table printer issue with https://github.com/shirok/Gauche/issues/1032
2024/05/15 14:12:58 UTCleah2
#
Thanks. At least Gauche properly works when one defines two macros and only exports one, so the local definitions are just convenience. :)
2024/05/15 14:21:39 UTCleah2
#
I wonder if the SRFI-147 reference implementation could work given er-macro-transformer...