FogBugz (Case [Issue]20525) _Inbox - EPICEA Adding polymorphic source method

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

FogBugz (Case [Issue]20525) _Inbox - EPICEA Adding polymorphic source method

Pharo Issue Tracker
FogBugz Notification
avatar
Stephane Ducasse opened Case 20525: EPICEA Adding polymorphic source method and assigned it to Everyone:
Enhancement in Project:  _Inbox: Not Spam  •  You are subscribed to this case
I would like to have a polymorphic API source so that we can either write at the level of the leaves or higher polymorphic code.

For example the pillar fileouter is done that way:

Object subclass: #EpPillarExporter
uses: EpTEventVisitor
instanceVariableNames: 'file stream'
classVariableNames: ''
package: 'EpiceaPillarOutputer'

wrappedCode: aChangeEntity
stream
nextPutAll: '[[[';
newLine.
stream
nextPutAll:
(aChangeEntity source
copyReplaceAll: Character cr asString
with: OSPlatform current lineEnding).
stream
newLine;
nextPutAll: ']]]';
newLine

visitClassChange: aChange
self wrappedCode: aChange

visitEvent: aChange
"does nothing by default"
^ self

visitMethodChange: aChange

self wrappedCode: aChange

EPClassAddition >> source
"Return the current definition. This message is polymorph for modification and methods"

^ class definitionSource

EPClassModification >> source
"Return the current definition. This message is polymorph for modification and methods"

^ newClass definitionSource

EPMethodAddition >> source
"Return the current definition. This message is polymorph for modification and methods"

^ String
streamContents: [ :st |
st nextPutAll: self method realClass name asString.
self method isMetaSide
ifTrue: [ st nextPutAll: ' class' ].
st nextPutAll: ' >> '.
st nextPutAll: self method sourceCode ]

EPMethodAddition >> method

^ method

EPMethodModification >> method
^ self newMethod

EPMethodModification >> source

^ String
streamContents: [ :st |
st nextPutAll: self method realClass name asString.
self method isMetaSide
ifTrue: [ st nextPutAll: ' class' ].
st nextPutAll: ' >> '.
st nextPutAll: self method sourceCode ]

I coded this in the car so once we agree I can do a pass.
Priority Priority: 5 – Fix If Time Status Status: Work Needed
Assigned To Assigned to: Everyone Milestone Milestone: Pharo7.0

Go to Case
No longer need updates? Unsubscribe from this case.

Don't want FogBugz notifications anymore? Update your preferences.

FogBugz

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
https://lists.gforge.inria.fr/mailman/listinfo/pharo-bugtracker