snorgers | 1 Jan 2009 12:51
Picon
Favicon

Re: A proper Match clause


The best way is to patch the t* machine indeed, but you do get correct
type checking for some important subclass
of cases by this scheme and that was the simplest way to get some type-
checking. what I could do is to translate CAR to myhead
and CDR to mytail and use something like

(datatype mylist

   X : A * B;
=========
   (myhead X) : A;

   X : A * B;
==========
   (mytail X) : A;

    X: (list A);
===========
   (myhead X) : A;

    X : (list A)
===========
   (mytail X) : (list A);)

And perhaps get some better typechackability. Later at lisp-form we
can retranslate to CDR and CAR or try to define mytail and mycdr as
inline.
This will get some extra functionality, but still you will not have
all the functionallity at your hands and this will still be one ugly
hack. after all the only thing
that has to be done is to typecheck as a standard define with some
free variables included that already have a type decided.

You are right that sugars are not macros, But I did indeed implement
macros in sugars that I hope to work correctly now.
(The hard part is to make sure that the macroexpansion is recursive
and that others sugars and standard transformations are re-done
after a macroexpansion) together with some backquoting like splicing
facilities I now have a smooth systemt to do code transformations
in Qi so now I never define lisp macros.

/Stefan
On 1 Jan, 08:24, Dave <d...@...> wrote:
> Ahem... ((/. X E) A) == (let X A E)

Gmane