Well... you have the cascading that provides you that. book1 title:'C Programming'; author: 'Nuha Ali '; subject: 'C Programming Tutorial'; book_id: 6495407. What I would like, sometimes, is the option to nest cascades, very much like the WITH DO construct of Pascal, Basic and others. But also I take this as a hint of some refactoring needed in my objects. Regards, Esteban A. Maringolo El lun., 4 mar. 2019 a las 10:07, Tim Mackinnon (<tim@testit.works>) escribió:
Iâve noticed that as weâve progressed there has been a move to more concise and fluid code - e.g. I quite like the new String streaming stuff
e.g.
^ String streamContents: [ :stream | stream nextPut: â¦. ]
So I was wondering why we donât have a construct like Pascals with to avoid Book1.title, Book1.author etc.
(* book 1 specification *) With Book1 do begin title := 'C Programming'; author := 'Nuha Ali '; subject := 'C Programming Tutorial'; book_id := 6495407; end;
I often find it a bit tedious with code like the following which then needs an instvar...
self classes do: [ :class | | metaclass | metaclass := class metaclass. metaclass xxxx. mataclass yyyy. ]
Iâm wondering why we donât have #with:do:
class with: class metaclass do: [:metaclass | metaclass xxx. ]
But when such things arenât there - there is usually a good reason and Iâm curious ⦠this said, there are all kinds of other such tricks (which I rarely use that I keep coming across).
Tim