« Return to Thread: possibilities for macros in a typed language

Re: possibilities for macros in a typed language

by Christopher Diggins :: Rate this Message:

Reply to Author | View in Thread

> > In Cat "dup apply" has the type "(A (A (B -> C) -> D) -> D)"
>
> I'm not convinced this is useful. As a trivial example, it assigns
> '[swap] dup apply' the type 'A b -> A (C -> D) b'. Your system then
> rejects this type because (C -> D) is unknowable.

You are incorrect.
Cat infers the type as: ('a -> ('b 'c -> 'c 'b) 'a)
Why would you claim otherwise?

> > Type-checking is usually done after macro expansion.
>
> I was speaking here primarily from a pedagogical standpoint. With
> macros, you can no longer state that every space-delineated token is a
> function.

This is already not the case in Joy or Cat. (e.g. in Cat "define",
"[", "]", "{", "}").

- Christopher

 « Return to Thread: possibilities for macros in a typed language

LightInTheBox - Buy quality products at wholesale price!