[ENH] 'value:' raiseTo: 2 -> 'value:value:'

Mats Nygren nygren at sics.se
Wed Sep 6 15:22:55 UTC 2000


Dan Ingalls <Dan.Ingalls at disney.com> wrote:
> Mats Nygren <nygren at sics.se> asked...
> 
> >does this exist already, if so how would I have found it.
> 
> No it doesn't.  If it did, then typing
> 
> 	'abc'. 3. 'abcabcabc'
> 
> in the method finder should have found it.  Typing "repeat" there should also likely have found such a method.
> 
> There was a thread within the last year about efficient ways to generate repeated strings, but no code made it into the system.  It's worth going back to this if you can find it (or if someone else will point it out.

When I get the energy. For now since I'm doing
  ('value:' repeated: n) asSymbol
I might as well collect it into a method.

> I would suggest "repeated:" rather than "raiseTo:" both because it seems closer to common language, and to avoid confusion with "raisedTo:".

Thats ok. (But see my answer to Randal L. Schwartz, in short that
confusion isn't necessary a confusion)

> Methinks the stream message would not get used that much, so probably best to fold that logic inside the outer method.  And then you may want to read the earlier thread.

Agreed, just kind of liked the appearance of #repeated: this way. There
is one other issue however, I think it is good practice to append things
on streams instead of creating strings and having handy nextPut-messages
promotes that.

- M ;-)

> 
> 	- D





More information about the Squeak-dev mailing list