[racket] Turning car/cdr into multi-methods

From: Patrick Li (patrickli.2001 at gmail.com)
Date: Sun Oct 16 21:15:59 EDT 2011

Hello everyone,

I'm implementing a scheme of my own for fun and education, and I'm stuck at
the following point. I'm wondering whether someone could give me some tips.

I have the basic forms and functions implemented, and was planning on doing
everything from there using macros.

I also now have a multi-method system built up using macros.

But it's annoying that the basic functions such as car/cdr are still plain
functions and not multi-methods like everything else. I've tried re-defining
them at this point, without much luck. Somewhere or other, I fall into an
infinite recursion.

Does anyone have some tips for wrapping their heads around recursive things
like this?
e.g. writing multi-methods using normal functions, and then somehow turning
everything into multi-methods?
   OR writing an object system, where your classes are also objects, etc...

Thanks!
  -Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20111016/689d0c81/attachment.html>

Posted on the users mailing list.