No really I dont get the idea, composition decomposition is the bread and
butter of collection types in any language. Unless pharo has a weakness in
this area that I am not aware of, in python I had never such problem.
actually its a foremost reason to use them in the first place. Browsing is
a limitation of the browser which does not provide a special view for
variables but not that hard to amend with inspector.  And I find hard to
believe you prefer a ton of short methods instead one short one for
returning those values.

The only reason I can think in this case of icons is that compiling a
string as return value of a method to be used statically is easier/ more
convenient than defining a huge collection in the initialize method.

on the other hand would not make more sense to have all this data that
means nothing for the user as separate files and let them load at the
startup of the image ? Its not as if anyone would bother editing those huge
gibberish strings .

Thats the only way I see for avoiding long methods.

Or am I missing something here ?

On Sat, Apr 4, 2015 at 6:01 PM, Sven Van Caekenberghe <s...@stfx.eu> wrote:

> Because composition/decomposition is good (among others for re-use),
> because with separate entries you can browse them more easily, because we
> don't like long methods, ... You get the idea ;-)
>
> > On 04 Apr 2015, at 16:45, kilon alios <kilon.al...@gmail.com> wrote:
> >
> > once more I really dont like idea of methods returning single values.
> This also one of the reasons why Spec annoys me. Why not have Collection /
> Dictionary that stores all these strings ? Having 100 methods for 100 icons
> seems really ugly .  Instead one collection with 100 entries and a single
> method would be more than enough.
> >
> > I know its not just you that do this  and is how icons work in Pharo
> .Its basically how many things work like this inside Pharo. But I still
> dont get it.... why ?
> >
> > On Sat, Apr 4, 2015 at 5:15 PM, Peter Uhnák <i.uh...@gmail.com> wrote:
> > Aha, of course.
> > The program makes assumptions about the file name and since it is naming
> the method like the file it fails, because you can't have "-" in method
> name.
> > I could change it so it removes all non-alphanumeric characters from the
> name.
> >
> > Peter
> >
> > On Sat, Apr 4, 2015 at 3:52 PM, kilon alios <kilon.al...@gmail.com>
> wrote:
> > I found the problem
> >
> > "Norse_largeThe '-' prefix works only for literal numbers (use #negated
> instead) -> -cpcIconContents
> >     "Private - Method generated with the content of the file File @
> /Users/kilon/Downloads/Norse_large-cpc.png""
> >
> > looks like it does not like that i use "-" inside the file name. In the
> folder the name of the file is not Norse_large-cpc.png but
> Norse-large-cpc.png
> >
> > "-" has some special meaning here ?
> >
> > On Sat, Apr 4, 2015 at 4:12 PM, Peter Uhnák <i.uh...@gmail.com> wrote:
> > create file ? i thought the class only creates methods
> > yeah, I mean method
> >
> > anyway, the method is created , but it does not proceed to next png.
> Shouldn create a method for each png it finds in the directory ?
> > yes it should, it operates on a collection, so if
> > dir allFiles select: [ :each | each extension = 'png' ]
> > shows more then one file it should also create a method for each one,
> not just the first
> >
> > Peter
> >
> >
> >
>
>
>

Reply via email to