FogBugz (Case [Issue]10375) Compiler Opal - Simplify the Compiler API: cascades!

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

FogBugz (Case [Issue]10375) Compiler Opal - Simplify the Compiler API: cascades!

Pharo Issue Tracker
A FogBugz case was opened by Marcus Denker.

Case ID:      10375
Title:        Simplify the Compiler API: cascades!
Status:       Work Needed
Category:     Bug
Project:      Compiler Opal
Area:         Misc
Priority:     3 - Must Fix
Milestone:    Later
Assigned To:  Everyone

URL:          https://pharo.fogbugz.com/default.asp?10375

Right now the compiler api is a *mess*. Just a selection:

These are the public methods:

compile: textOrStream in: aClass classified: aCategory notifying: aRequestor ifFail: failBlock 

compile: textOrStream in: aClass notifying: aRequestor ifFail: failBlock 

compileNoPattern: textOrStream in: aClass context: aContext notifying: aRequestor ifFail: failBlock

evaluate: aString in: aContext to: aReceiver

evaluate: textOrStream in: aContext to: receiver notifying: aRequestor ifFail: failBlock

evaluate: textOrStream in: aContext to: receiver notifying: aRequestor ifFail: failBlock logged: logFlag

format: textOrStream in: aClass notifying: aRequestor

from: textOrStream class: aClass classified: aCategory context: aContext notifying: req

parse: textOrStream in: aClass notifying: req

translate: aStream noPattern: noPattern ifFail: failBlock parser: parser

plus some private

translate: aStream noPattern: noPattern ifFail: failBlock

from: textOrStream class: aClass context: aContext notifying: req

format: aStream noPattern: noPattern ifFail: failBlock

and there are more on the class side:

evaluate: textOrString 

evaluate: textOrString for: anObject logged: logFlag 

evaluate: textOrString for: anObject notifying: aController logged: logFlag

evaluate: textOrString logged: logFlag 

evaluate: textOrString notifying: aController logged: logFlag 

format: textOrStream in: aClass notifying: aRequestor

*Plus* there is Parser:

parse: sourceStreamOrString class: behavior

parse: sourceStream class: class category: aCategory noPattern: noPattern context: ctxt notifying: req ifFail: aBlock 

parse: sourceStream class: class noPattern: noPattern context: ctxt notifying: req ifFail: aBlock 

parse: sourceStream class: class noPattern: noPattern notifying: req ifFail: aBlock

parseArgsAndTemps: aString notifying: req 

parseMethodComment: aString setPattern: aBlock

parseParameterNames: aString 

parseSelector: aString 

 

Solution:

do not use these methods with multiple parameters

Accessors with good default values for everything

Clients just set what they need

And then call a command: parse, compile, format, evaluate

The command could take the stringOrStream as the parameter.


You are subscribed to this case.  If you do not want to receive automatic notifications in the future, unsubscribe (https://pharo.fogbugz.com/default.asp?pre=preUnsubscribe&pg=pgEditBug&command=view&ixBug=10375) from this case.

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