A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1255.mcz ==================== Summary ==================== Name: Kernel-ct.1255 Author: ct Time: 9 August 2019, 10:08:18.927412 pm UUID: 2355c96f-9cc4-2f45-aebe-385f6465737e Ancestors: Kernel-mt.1254 Propose convenience method for pragma analysis =============== Diff against Kernel-mt.1254 =============== Item was added: + ----- Method: CompiledMethod>>hasPragma: (in category 'accessing-pragmas & properties') ----- + hasPragma: aSymbol + + ^ (self pragmaAt: aSymbol) notNil! |
Hi,
is there any reason why #pragmas, #pragmaAt: and #pragmasAt: are imeplemented both in CompiledBlock and CompiledMethod, but not as abstract in CompiledCode (^self subclassResponsibility)? Is it a code smell?
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von [hidden email] <[hidden email]>
Gesendet: Freitag, 9. August 2019 22:08:26 An: [hidden email] Betreff: [squeak-dev] The Inbox: Kernel-ct.1255.mcz A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1255.mcz ==================== Summary ==================== Name: Kernel-ct.1255 Author: ct Time: 9 August 2019, 10:08:18.927412 pm UUID: 2355c96f-9cc4-2f45-aebe-385f6465737e Ancestors: Kernel-mt.1254 Propose convenience method for pragma analysis =============== Diff against Kernel-mt.1254 =============== Item was added: + ----- Method: CompiledMethod>>hasPragma: (in category 'accessing-pragmas & properties') ----- + hasPragma: aSymbol + + ^ (self pragmaAt: aSymbol) notNil!
Carpe Squeak!
|
In reply to this post by commits-2
I think the typical way to access Pragmas is the other way round.
Instead of asking some Compiled Method, rather use the class-side methods of Pragma to _query_ for pragmas. That way, you would only touch compiled methods if necessary. Best regards -Tobias > On 09.08.2019, at 22:08, [hidden email] wrote: > > A new version of Kernel was added to project The Inbox: > http://source.squeak.org/inbox/Kernel-ct.1255.mcz > > ==================== Summary ==================== > > Name: Kernel-ct.1255 > Author: ct > Time: 9 August 2019, 10:08:18.927412 pm > UUID: 2355c96f-9cc4-2f45-aebe-385f6465737e > Ancestors: Kernel-mt.1254 > > Propose convenience method for pragma analysis > > =============== Diff against Kernel-mt.1254 =============== > > Item was added: > + ----- Method: CompiledMethod>>hasPragma: (in category 'accessing-pragmas & properties') ----- > + hasPragma: aSymbol > + > + ^ (self pragmaAt: aSymbol) notNil! > > |
But do you always do queries?
For example, Process>>#releaseCriticalSection: just checks if a method has a pragma. Vivide seems to do so sometimes, too.
Or do I miss an easier protocol?
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Tobias Pape <[hidden email]>
Gesendet: Freitag, 9. August 2019 22:31:02 An: [hidden email] Betreff: Re: [squeak-dev] The Inbox: Kernel-ct.1255.mcz I think the typical way to access Pragmas is the other way round.
Instead of asking some Compiled Method, rather use the class-side methods of Pragma to _query_ for pragmas. That way, you would only touch compiled methods if necessary. Best regards -Tobias > On 09.08.2019, at 22:08, [hidden email] wrote: > > A new version of Kernel was added to project The Inbox: > http://source.squeak.org/inbox/Kernel-ct.1255.mcz > > ==================== Summary ==================== > > Name: Kernel-ct.1255 > Author: ct > Time: 9 August 2019, 10:08:18.927412 pm > UUID: 2355c96f-9cc4-2f45-aebe-385f6465737e > Ancestors: Kernel-mt.1254 > > Propose convenience method for pragma analysis > > =============== Diff against Kernel-mt.1254 =============== > > Item was added: > + ----- Method: CompiledMethod>>hasPragma: (in category 'accessing-pragmas & properties') ----- > + hasPragma: aSymbol > + > + ^ (self pragmaAt: aSymbol) notNil! > >
Carpe Squeak!
|
Free forum by Nabble | Edit this page |