[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-smalltalk] [PATCH] revamp CTypes, part 1, and some questions
From: |
Paolo Bonzini |
Subject: |
[Help-smalltalk] [PATCH] revamp CTypes, part 1, and some questions |
Date: |
Mon, 13 Aug 2007 11:01:04 +0200 |
User-agent: |
Thunderbird 2.0.0.6 (Macintosh/20070728) |
This is a refactoring that came out while looking at GDBM conversion.
The root problem is that there are forward references to a class in a
<cCall: ...> pragma. In the conversion of GDBM, we get
Object subclass: GDBM [
... [
<cCall: ... returning: DatumStruct type>
]
CStruct subclass: DatumStruct [
]
Pragma arguments are evaluated at compile-time, which breaks horribly
because DatumStruct is still undefined (and hence nil).
Now I'm tempted to break source-code compatibility. How?
1) Requiring DatumStruct to come first is not possible, because of
possible circular references. (It would work in this case though).
2) Changing "DatumStruct type" to "#{DatumStruct}" seems like a good
idea anyway. It would match the way types are referenced in CStructs,
and likewise, we could allow #(#ptr #{DatumStruct}) etc. Do you people
agree?
It would also be possible to add a hack into scripts/Convert.st in some
way to rewrite "DatumStruct type" into "#{DatumStruct}".
If anybody has an idea how to avoid this, please shoot.
Paolo
* looking for address@hidden/smalltalk--devo--2.2--patch-512 to compare with
* auto-adding address@hidden/smalltalk--devo--2.2--patch-512 to greedy revision
library /Users/bonzinip/Archives/revlib
* found immediate ancestor revision in library
(address@hidden/smalltalk--devo--2.2--patch-511)
* patching for this revision (address@hidden/smalltalk--devo--2.2--patch-512)
* comparing to address@hidden/smalltalk--devo--2.2--patch-512
- [Help-smalltalk] [PATCH] revamp CTypes, part 1, and some questions,
Paolo Bonzini <=