Re: [Pharo-users] Simple Spec Examples

2013-10-12 Thread Camillo Bruni
On 2013-10-12, at 15:37, Benjamin wrote: > Actually, you can do (1->2 -> 3) if you have multiple levels :) > > But clearly I will introduce a real data structure here. > I just wanted to quickly hack it and have something where > I can do #head and #tail easily, and keep a simple way to write

Re: [Pharo-users] Simple Spec Examples

2013-10-12 Thread Sean P. DeNigris
Benjamin Van Ryseghem-2 wrote > Actually, you can do (1->2 -> 3) if you have multiple levels :) Oh, a *nested* association! Yes, that's much better ;p - Cheers, Sean -- View this message in context: http://forum.world.st/Spec-Lists-setting-the-selection-tp4713776p4714067.html Sent from the

Re: [Pharo-users] Simple Spec Examples

2013-10-12 Thread Benjamin
Actually, you can do (1->2 -> 3) if you have multiple levels :) But clearly I will introduce a real data structure here. I just wanted to quickly hack it and have something where I can do #head and #tail easily, and keep a simple way to write it :) Ben On Oct 12, 2013, at 3:04 PM, Sean P. DeNi

Re: [Pharo-users] Simple Spec Examples

2013-10-12 Thread Sean P. DeNigris
Camillo Bruni-3 wrote > for me that implies that the tree contains an actual item (1 -> 11). Yes, not only is it a C-style obfuscation (remember how much confusing the event buffers are!!), but what do you do when the tree is more than two levels? Definitely an object is calling to be born here...

Re: [Pharo-users] Simple Spec Examples

2013-10-11 Thread btc
Camillo Bruni wrote: Would it be possible to change the name of the selector? tree selectedItem: (1 -> 11) for me that implies that the tree contains an actual item (1 -> 11). What you want is maybe, #selectedPath: or #selectedItem:1 withParents:{11} I'd vote for reciprocal methods #se

Re: [Pharo-users] Simple Spec Examples

2013-10-11 Thread benjamin.vanryseghem.ph...@gmail.com
Indeed, it was just a first try to have something to build a reflection on :-) Changing the name is always easier than implementing something new (and it's also easier to have the community involved at this level). I think that #selectedItem is somehow wrong in the context of a tree. I will

Re: [Pharo-users] Simple Spec Examples

2013-10-11 Thread Stéphane Ducasse
agreed :) > Would it be possible to change the name of the selector? > > tree selectedItem: (1 -> 11) > > for me that implies that the tree contains an actual item (1 -> 11). > What you want is maybe, #selectedPath: or #selectedItem:1 withParents:{11} > > My general rule is: Each time you have

Re: [Pharo-users] Simple Spec Examples

2013-10-11 Thread Johan Fabry
I agree with Camillo in that I think it would be better to use specific selectors, e.g. selectedItem:withParents: as it better reveals the intention. Just my 2 cents ... On Oct 11, 2013, at 3:23 PM, Camillo Bruni wrote: > Would it be possible to change the name of the selector? > > tree sele

Re: [Pharo-users] Simple Spec Examples

2013-10-11 Thread Camillo Bruni
Would it be possible to change the name of the selector? tree selectedItem: (1 -> 11) for me that implies that the tree contains an actual item (1 -> 11). What you want is maybe, #selectedPath: or #selectedItem:1 withParents:{11} My general rule is: Each time you have to use an association or a

Re: [Pharo-users] Simple Spec Examples

2013-10-11 Thread btc
b...@openinworld.com wrote: Benjamin wrote: > Ben > > On Oct 11, 2013, at 9:24 AM, b...@openinworld.com wrote: > > >> b...@openinworld.com wrote: >> >>> I found it hard to find documentation on Spec beyond [1],[2],[3], some of which seem to have changed some syntax since they were written

Re: [Pharo-users] Simple Spec Examples

2013-10-11 Thread btc
Benjamin wrote: Ben On Oct 11, 2013, at 9:24 AM, b...@openinworld.com wrote: b...@openinworld.com wrote: I found it hard to find documentation on Spec beyond [1],[2],[3], some of which seem to have changed some syntax since they were written. I've been piecing th

Re: [Pharo-users] Simple Spec Examples

2013-10-11 Thread btc
Benjamin wrote: Ben On Oct 11, 2013, at 9:24 AM, b...@openinworld.com wrote: b...@openinworld.com wrote: I found it hard to find documentation on Spec beyond [1],[2],[3], some of which seem to have changed some syntax since they were written. I've been piecing th

Re: [Pharo-users] Simple Spec Examples (was: Spec Lists - setting the selection)

2013-10-11 Thread Benjamin
Ben On Oct 11, 2013, at 9:24 AM, b...@openinworld.com wrote: > b...@openinworld.com wrote: >> >> I found it hard to find documentation on Spec beyond [1],[2],[3], some of >> which seem to have changed some syntax since they were written. I've been >> piecing things together to work out how t