[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC - GL in scheme (long, with code)



Hi Robert,

Looks like you're off to a flying start. I have opinions on just a
few of your issues:

Quoting Robert Kooima:
> A very large majority of GL functions have side effects.  So, naming
> the procedures as gl-do-something! might be in order.  However, the
> state being changed is external to the environment.  A ! on every GL
> call begins to look cluttered anyway.  Thoughts on this?

Skip the "!". 

Early in development, some methods for MrEd objects had "!", but we
soon realized that the "!" wasn't helpful. Probably the same here.

> Should the GL extension be packed into a unit somehow?

The main reasons for packing code into a unit are:

 * the code has imports that could be usefully parameterized; and

 * the code has state, but needs to support multiple instantiation.

I think that neither of those reasons apply, so a plain module will
work fine (but do package it as a module).

> An alternative implementation would have the C functions assume their
> arguments are perfect.  Scheme wrappers would check type and count.
> Is there any advantage or disadvantage to this approach?

I recommend checking in C. For the forseeable future, the cost of
checking is negligible (i.e., relative to other PLT Scheme overheads)
--- and since the cost is negligible, there's no reason to skip it.

Matthew