Re: [Pharo-users] Metaprogramming facilities

2016-05-03 Thread Peter Uhnák
> > More importantly the autogenerated code is a bit stupid > > TBPost >> title: anObject > title := anObject > > this is stupid, so even for generated one I select the argument, press > ctrl+t (or right click + suggestions) and select 'rename' ... and rename it > into something meaningful like

Re: [Pharo-users] Metaprogramming facilities

2016-05-03 Thread Peter Uhnák
1) write them by hand annoying typing required 2) use Class refactorings (right click on class -> refactoring -> class refactoring -> generate accessors; or ctrl+h+a) this will ask you to choose for all attributes… good initially, but really stupid if you are providing e.g. just getters (because

Re: [Pharo-users] Metaprogramming facilities

2016-05-03 Thread stepharo
Code not tested but #('title' 'text') do: [:each | | body | body := String new streamContents: [ :s | s nextPutAll: each ; cr; tab; nextPutAll: '^ '; nextPutAll: each ;

Re: [Pharo-users] Metaprogramming facilities

2016-05-02 Thread Cédrick Béler
Or even quicker with the shortcut CMD+H+A Cheers, Cédrik

[Pharo-users] Metaprogramming facilities

2016-05-02 Thread Victor RENE
In the TinyBlog mini-project of the MOOC, we start by creating the model. However, since I basically finished the exercises, I wanted to go one step further and ask you guys, what is the correct way _not_ to write all gettters / setters for the fields. TBPost >> title ^ title TBPost >> titl