This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: no class-of ?
On Sep 24, 2017, at 5:52 PM, Per Bothner <per@bothner.com> wrote:
>
> Instead, I implemented a somewhat more general mechanism: If an object that
> needs to be referenced as a literal implements HasOwningField, we use the
> getOwningField of that interface to find the corresponding static field.
That's working, thanks.
My validate-apply handler now looks like:
(define-validate validateEnsureBoolean (exp required proc)
((exp:isSimple 1 1)
(let* ((e0 (visit-exp (exp:getArg 0)))
(t0 (e0:getType)))
(cond ((eq? t0 boolean) e0)
((eq? t0 int) (apply-exp = e0 0))
((eq? t0 void) (begin-exp e0 #t))
(else (gnu.expr.ErrorExp
(format #f "unsupported expression type: ~a" t0)
(get-compilation)))))))
That looks very similar to my original hypothetical macro, so I'm
content.
Sorry for hijacking your thread, Sonny!
--
Jamison Hope
The PTR Group
www.theptrgroup.com