Skip to content

Commit

Permalink
added full package names to the exported classes to prevent name clashes
Browse files Browse the repository at this point in the history
  • Loading branch information
camillobruni committed Jan 20, 2014
1 parent 44af72c commit a51770b
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
evaluation
clearNative
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"annotationAt:" : "ToonVerwaest 3/26/2010 19:22",
"annotations" : "ToonVerwaest 3/26/2010 14:45",
"annotations:" : "ToonVerwaest 3/26/2010 14:45",
"clearNative" : "CamilloBruni 11/1/2010 10:12",
"depth" : "ToonVerwaest 3/26/2010 14:45",
"do:" : "ToonVerwaest 5/11/2010 18:42",
"first" : "ToonVerwaest 3/26/2010 15:13",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ createCFile
self visitSymbol: (PSymbol named: #'ensurePackageNamed:').

sortedClasses do: [ :pclass |
stream << 'init_' << pclass pharoName << '_methods();'; lf ].
stream << 'init_' << pclass pharoFullName << '_methods();'; lf ].
stream lf; << (self idFor: root); << ' = Eval_Send0((Optr)Organization_RootPackage_Class, SMB_new);'; lf.
root packagesDo: [ :package |
name := package shortName asPObject.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
convenience
declareClass: aPClass
stream << 'init_' << aPClass pharoName << '_layout();'; lf.
stream << 'init_' << aPClass pharoFullName << '_layout();'; lf.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
"addGlobal:" : "CamilloBruni 8/9/2010 22:31",
"assign:to:" : "CamilloBruni 7/26/2010 23:25",
"createAutoCompletionFile" : "ToonVerwaest 9/6/2010 15:11",
"createCFile" : "ToonVerwaest 9/30/2010 14:34",
"createCFile" : "CamilloBruni 11/1/2010 10:40",
"createClass:" : "ToonVerwaest 8/10/2010 14:33",
"createHFile" : "ToonVerwaest 8/31/2010 16:10",
"createInternalClass:" : "CamilloBruni 8/1/2010 23:23",
"createSized:with:" : "CamilloBruni 7/26/2010 23:40",
"currentClass:" : "CamilloBruni 7/28/2010 01:12",
"declare:to:type:" : "CamilloBruni 7/26/2010 23:29",
"declareClass:" : "ToonVerwaest 9/30/2010 14:35",
"declareClass:" : "CamilloBruni 11/1/2010 10:40",
"declareClassReference:" : "CamilloBruni 7/26/2010 23:29",
"export" : "CamilloBruni 8/25/2010 13:53",
"export:" : "ToonVerwaest 8/3/2010 21:20",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
pharoFullName
<preventExport>
^ ((self package asString replaceAll:$. with: $_), '_', sclass name)
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"package" : "ToonVerwaest 3/25/2010 12:39",
"package:" : "ToonVerwaest 3/25/2010 12:39",
"pathDo:separatedBy:" : "ToonVerwaest 8/31/2010 16:04",
"pharoName" : "ToonVerwaest 9/30/2010 14:33",
"pharoFullName" : "CamilloBruni 11/1/2010 10:43",
"pharoName" : "CamilloBruni 11/1/2010 10:39",
"pmetaclass" : "ToonVerwaest 3/25/2010 12:39",
"printOn:" : "ToonVerwaest 8/6/2010 17:32",
"sclass" : "ToonVerwaest 3/25/2010 12:39",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
exporting
createFooter
stream << 'void init_' << currentClass pharoName << '_methods() {'; indent; lf.
stream << 'void init_' << currentClass pharoFullName << '_methods() {'; indent; lf.
currentClass methods do:[ :method |
stream << 'init_' << (self idFor: method selector) << '();'; lf ].
currentClass pmetaclass methods do:[ :method |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ exporting
createHFile
| guardName fileStream |
stream := PIndentableWriteStream on: (String new: 500).
guardName := 'PINOCCHIO_LIB_' , currentClass pharoName asUppercase.
guardName := 'PINOCCHIO_LIB_' , currentClass pharoFullName asUppercase.
self startGuard: guardName.
self include: 'pinocchio.h'.
stream << 'extern void init_' << currentClass pharoName << '_methods();'; lf; lf.
stream << 'extern void init_' << currentClass pharoName << '_layout();'; lf; lf.
stream << 'extern void init_' << currentClass pharoFullName << '_methods();'; lf; lf.
stream << 'extern void init_' << currentClass pharoFullName << '_layout();'; lf; lf.
self include: 'lib/lib.h'.

stream lf.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exportLayout
| oldStream layoutStream |
oldStream := stream.
stream := layoutStream := PIndentableWriteStream on: (String new: 1000).
stream << 'void init_' << currentClass pharoName << '_layout() {'; indent; lf.
stream << 'void init_' << currentClass pharoFullName << '_layout() {'; indent; lf.

self createClass: currentClass.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
"with:" : "CamilloBruni 7/27/2010 00:33" },
"instance" : {
"createCFile" : "ToonVerwaest 8/31/2010 16:03",
"createFooter" : "ToonVerwaest 9/30/2010 14:36",
"createHFile" : "ToonVerwaest 9/30/2010 15:04",
"createFooter" : "CamilloBruni 11/1/2010 10:40",
"createHFile" : "CamilloBruni 11/1/2010 10:41",
"createHeader" : "ToonVerwaest 8/31/2010 16:03",
"createMethodSourceStringFor:" : "ToonVerwaest 5/20/2010 20:30",
"export:" : "CamilloBruni 7/28/2010 01:13",
"exportClassMethods" : "CamilloBruni 7/28/2010 01:13",
"exportLayout" : "ToonVerwaest 9/30/2010 14:36",
"exportLayout" : "CamilloBruni 11/1/2010 10:40",
"exportMethods" : "ToonVerwaest 5/20/2010 20:35",
"hasVisited:" : "CamilloBruni 7/27/2010 13:36",
"initialize" : "ToonVerwaest 3/25/2010 12:39",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
evaluation
removeNatives
self methods do: [ :selector :method|
method clearNative ]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"class" : {
},
"removeNatives" : "CamilloBruni 11/1/2010 10:12" },
"instance" : {
"addAll:" : "ToonVerwaest 8/4/2010 09:54",
"at:" : "ToonVerwaest 8/20/2010 12:08",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
visiting
currentClassName
(currentClass isKindOf: PMetaclass) ifTrue: [
currentClass name, '_class'].
^ currentClass name.
| id |
id := self rawClassIdFor: currentClass.
(currentClass isKindOf: PMetaclass) ifFalse: [ ^ id ].
^ id, '_class'
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
visiting
rawClassIdFor: aClass
| id |
id := aClass package asString replaceAll: $. with: $_.
^ id, '_', aClass name.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ visitSlot: aSlot
currentClass ifNil: [
uidCounter := uidCounter + 1.
^ 'slot_', (self rawSymbolIdFor: aSlot name), '_', uidCounter asString ].
^ 'slot_', currentClass name, '_', (self rawSymbolIdFor: aSlot name).
^ 'slot_', self currentClassName, '_', (self rawSymbolIdFor: aSlot name).
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"instance" : {
"at:" : "CamilloBruni 8/9/2010 18:08",
"currentClass:" : "CamilloBruni 7/27/2010 23:01",
"currentClassName" : "ToonVerwaest 9/7/2010 16:00",
"currentClassName" : "CamilloBruni 11/1/2010 10:56",
"idFor:" : "CamilloBruni 7/27/2010 09:36",
"idForLayout:" : "CamilloBruni 7/28/2010 01:08",
"idForSizedLayout:named:" : "CamilloBruni 7/28/2010 00:03",
"initialize" : "ToonVerwaest 8/4/2010 15:08",
"rawClassIdFor:" : "CamilloBruni 11/1/2010 10:56",
"rawDefaultIdFor:" : "ToonVerwaest 9/30/2010 14:22",
"rawIdFor:" : "ToonVerwaest 8/3/2010 15:18",
"rawSymbolIdFor:" : "ToonVerwaest 9/7/2010 16:02",
Expand Down Expand Up @@ -37,7 +38,7 @@
"visitSTString:" : "CamilloBruni 7/28/2010 00:51",
"visitSTSymbol:" : "CamilloBruni 8/9/2010 18:06",
"visitSelf:" : "CamilloBruni 7/27/2010 00:12",
"visitSlot:" : "ToonVerwaest 9/7/2010 16:03",
"visitSlot:" : "CamilloBruni 11/1/2010 10:54",
"visitSmallInt:" : "CamilloBruni 7/28/2010 00:51",
"visitString:" : "CamilloBruni 7/28/2010 00:51",
"visitSymbol:" : "CamilloBruni 7/28/2010 00:52",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
as yet unclassified
clearNative
<pPrimitive: #clearNative plugin: #'AST.NativeMethod'>
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"instance" : {
"accept:" : "CamilloBruni 6/8/2010 19:54",
"accept:on:message:boundBy:" : "ToonVerwaest 3/26/2010 23:03",
"clearNative" : "CamilloBruni 11/1/2010 10:15",
"ctype" : "CamilloBruni 6/9/2010 16:14",
"inspectChildrenOn:" : "ToonVerwaest 9/28/2010 11:47" } }
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ transformClass: sclass
aPinocchioClass package: (self ensurePackageFor: aPinocchioClass).
self declareClassReference: (self ensureClassReferenceFor: aPinocchioClass) as: aPinocchioClass pharoName.

Transcript show: aPinocchioClass pharoName asSymbol; cr.
"Transcript show: aPinocchioClass pharoName asSymbol; cr."

"(aPinocchioClass package at: aPinocchioClass name) should not isNil.
(aPinocchioClass package at: aPinocchioClass name) pclass should not isNil."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"pclassForName:" : "CamilloBruni 8/1/2010 22:50",
"progress" : "ToonVerwaest 3/25/2010 12:44",
"root" : "ToonVerwaest 3/25/2010 12:44",
"transformClass:" : "ToonVerwaest 9/30/2010 14:39",
"transformClass:" : "CamilloBruni 11/1/2010 10:41",
"transformClassMethodsFor:" : "CamilloBruni 8/1/2010 09:52",
"transformClassSideOf:" : "CamilloBruni 8/1/2010 11:48",
"transformMethod:" : "ToonVerwaest 5/20/2010 18:06",
Expand Down
2 changes: 1 addition & 1 deletion repository/Pinocchio.package/monticello.meta/categories.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ SystemOrganization addCategory: #Pinocchio!
SystemOrganization addCategory: #'Pinocchio-Alias'!
SystemOrganization addCategory: #'Pinocchio-Bridge'!
SystemOrganization addCategory: #'Pinocchio-Bridge-Test'!
SystemOrganization addCategory: #'Pinocchio-Chronology'!
SystemOrganization addCategory: #'Pinocchio-Collection'!
SystemOrganization addCategory: #'Pinocchio-Chronology'!
SystemOrganization addCategory: #'Pinocchio-Collection-Stream'!
SystemOrganization addCategory: #'Pinocchio-Collection-Benchmark'!
SystemOrganization addCategory: #'Pinocchio-Concurrency'!
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
(name 'PBenchmark-CamilloBruni.10' message 'adding base benchmarks' id '0648becf-fe68-4983-8a48-fe0e475ec20e' date '20 October 2010' time '11:39:50 am' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.9' message 'fixing probing in PBenchmark' id 'f009680e-17b1-477b-9ef9-fbf6fd355bdb' date '8 September 2010' time '3:28:49 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.8' message 'moving benchmarks around and adding them again to the exported basic classes' id 'b207caf6-3b17-4311-891c-f8619e017b3b' date '6 September 2010' time '4:38:51 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-ToonVerwaest.7' message 'giving PBenchmark commit a try' id '3aa5bc79-e991-4892-9708-3ef843cf532f' date '6 September 2010' time '11:24:56 am' author 'ToonVerwaest' ancestors ((name 'PBenchmark-CamilloBruni.6' message 'adding required package PBenchmark again.' id 'b566f76e-7c85-42f1-9a34-a47e2efe2179' date '5 September 2010' time '10:44:44 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.5' message 'reenabling to:do: opcodes. seems to break some functionality in the arrayed code (at:put:)' id 'b211e4b3-fbe9-4fc7-855d-cd0aafce6a11' date '29 August 2010' time '5:22:01 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.4' message 'adding more Float/Int support to make the Benchmarks work' id 'bc5b2fd9-cad1-423e-9262-fd6b31f56c54' date '28 August 2010' time '8:18:59 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.3' message 'adding basic float support' id '3bd1f4ec-c182-4bec-ae1b-323075727a02' date '27 August 2010' time '10:43:24 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.2' message 'adding support for milliseconds and microseconds on Chronology.Time' id 'e2ea2ea9-b185-4ed7-97fb-e1acf7c5c3e8' date '27 August 2010' time '4:40:24 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.1' message 'trying to add PBenchmark dependency' id 'bcbcc565-a391-4233-94b8-d4943ad2efb0' date '25 August 2010' time '5:17:57 pm' author 'CamilloBruni' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
(name 'PBenchmark-CamilloBruni.11' message 'added full package names to the exported classes to prevent name clashes' id '37defb0f-7d48-4da5-a812-714b0f75eb79' date '1 November 2010' time '11:06:07 am' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.10' message 'adding base benchmarks' id '0648becf-fe68-4983-8a48-fe0e475ec20e' date '20 October 2010' time '11:39:50 am' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.9' message 'fixing probing in PBenchmark' id 'f009680e-17b1-477b-9ef9-fbf6fd355bdb' date '8 September 2010' time '3:28:49 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.8' message 'moving benchmarks around and adding them again to the exported basic classes' id 'b207caf6-3b17-4311-891c-f8619e017b3b' date '6 September 2010' time '4:38:51 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-ToonVerwaest.7' message 'giving PBenchmark commit a try' id '3aa5bc79-e991-4892-9708-3ef843cf532f' date '6 September 2010' time '11:24:56 am' author 'ToonVerwaest' ancestors ((name 'PBenchmark-CamilloBruni.6' message 'adding required package PBenchmark again.' id 'b566f76e-7c85-42f1-9a34-a47e2efe2179' date '5 September 2010' time '10:44:44 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.5' message 'reenabling to:do: opcodes. seems to break some functionality in the arrayed code (at:put:)' id 'b211e4b3-fbe9-4fc7-855d-cd0aafce6a11' date '29 August 2010' time '5:22:01 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.4' message 'adding more Float/Int support to make the Benchmarks work' id 'bc5b2fd9-cad1-423e-9262-fd6b31f56c54' date '28 August 2010' time '8:18:59 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.3' message 'adding basic float support' id '3bd1f4ec-c182-4bec-ae1b-323075727a02' date '27 August 2010' time '10:43:24 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.2' message 'adding support for milliseconds and microseconds on Chronology.Time' id 'e2ea2ea9-b185-4ed7-97fb-e1acf7c5c3e8' date '27 August 2010' time '4:40:24 pm' author 'CamilloBruni' ancestors ((name 'PBenchmark-CamilloBruni.1' message 'trying to add PBenchmark dependency' id 'bcbcc565-a391-4233-94b8-d4943ad2efb0' date '25 August 2010' time '5:17:57 pm' author 'CamilloBruni' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
2 changes: 1 addition & 1 deletion repository/Pinocchio.package/monticello.meta/version

Large diffs are not rendered by default.

0 comments on commit a51770b

Please sign in to comment.