[Cuis-dev] Interesting thoughts about Color

ken.dickey at whidbey.com ken.dickey at whidbey.com
Mon Apr 29 06:10:29 PDT 2019


Phil,

Naming is important. I am always for better naming.

asNumber, asString, asRope, .. I expect an #asDarker method to answer an 
object of class #Darker.

With respect to polymorphism, I will give a couple of examples where the 
code does not care about the shape or immutability of the underlying 
data:


vvv=== "foo and bar don't care" ===vvv

Feature require: #'Ropes'. "immutable strings"

foo := [ :s | s asLowercase].
  "both answer  'año Comé tomá Camión' "
(foo value: 'año Comé tomá Camión') asString.
(foo value: ('año Comé tomá Camión' asRope)) asString.

(foo value: ('año Comé tomá Camión' asRope)) class. "--> FlatRope"

bar := [ :v | v at: 2 ].
"all answer $b"
bar value: {#a. $b. 'c'.}.
bar value: ('abc' asRope).
bar value: 'abc'.
bar value: #abc.

^^^=== "foo and bar don't care" ===^^^

Does this make sense?

Cheers,
-KenD


More information about the Cuis-dev mailing list