[Openmcl-devel] getting CCL ready for CS graphics courses
Terje Norderhaug
terje at in-progress.com
Fri Jan 9 23:02:41 PST 2009
On Jan 9, 2009, at 10:20 PM, Alexander Repenning wrote:
> On Jan 8, 2009, at 6:37 PM, Terje Norderhaug wrote:
>> On Jan 8, 2009, at 5:05 PM, Alexander Repenning wrote:
>>> At least for the vector caveat we have a solution. The approach
>>> taken
>>> may sound a bit crazy. We are implementing vector constants with a
>>> combination of Lisp readers and Universally Unique Identifiers.
>>> Perhaps not super elegant, there is bound to be a better
>>> solution, but
>>> it works. Code at the end. A call to a vector function looks like
>>> this
>>>
>>> (glColor3fv {0.5 0.1 0.8})
>>>
>>> which is pretty close to what students "know" from C. The only issue
>>> is that getting the cached value is not that fast. The hash table
>>> access it the bottleneck.
>>
>> What about only looking up the value at compile time? As in:
>>
>> (glColor3fv #.{0.5 0.1 0.8})
>
> I don't think the Lisp compiler could handle that because it would
> try to dump a foreign pointer.
You may get beyond that by defining a make-load-form for your
representation of the gl vectors.
-- Terje Norderhaug
More information about the Openmcl-devel
mailing list