Can we remove #brickValue: ? I don't see how this is different from #cull: |
Can we remove #brickValue: ? Not really, it is implemented also in Object. It is used to script brick layout properties. So user can say: brick height: 10. brick height: #approximate. brick height: [ :b | b width * 2]. or even brick height: HeightStrategy new. so brickValue: is sent to any kind of object that is used as height. So without changing brick itself user can implement its own class and override brickValue: and have custom strategy to calculate height. Such practice is used in many places in brick. Cheers, Alex On Sun, Apr 26, 2015 at 12:16 AM, Nicolai Hess <[hidden email]> wrote:
|
2015-04-26 1:35 GMT+02:00 Aliaksei Syrel <[hidden email]>:
Ah, ok, I missed that one.
I saw the call to brickValue: in GTSpotter and GLMAnimation, is it only used for brick attributes, like in your example above? nicolai
|
In reply to this post by Aliaksei Syrel
brick height: #approximate.
brick height: [ :b | b width * 2].
while I can see that this too cases are similar, sending value to any object is always to me over polymorphism. If we could not extend Object, the provider could simply add value in his class? We are always trying to remove messages from Object.
|
Free forum by Nabble | Edit this page |