Roassal callbacks as events

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Roassal callbacks as events

Peter Uhnak
Hi,

this is just an idea that's been bugging me for some time...
what if callbacks could be attached just like regular events?

e.g.
aBox when: TRExtentChanged do: [ :event | (self parentFor: aBox) rebuild ]

Is there benefit in having some events as events and some as callbacks? Isn't event more versatile?

What do you think?

I should probably check how this is done in Bloc...

Peter

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal callbacks as events

Tudor Girba-2
+1

Doru

On Mon, Jul 27, 2015 at 11:55 AM, Peter Uhnák <[hidden email]> wrote:
Hi,

this is just an idea that's been bugging me for some time...
what if callbacks could be attached just like regular events?

e.g.
aBox when: TRExtentChanged do: [ :event | (self parentFor: aBox) rebuild ]

Is there benefit in having some events as events and some as callbacks? Isn't event more versatile?

What do you think?

I should probably check how this is done in Bloc...

Peter

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal callbacks as events

abergel
In reply to this post by Peter Uhnak
Hi Peter,

I do not know whether this is the jetlag effect or not, but I do not understand your email.

What do you mean that a callback be attached just like regular event? 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 27, 2015, at 6:55 AM, Peter Uhnák <[hidden email]> wrote:

Hi,

this is just an idea that's been bugging me for some time...
what if callbacks could be attached just like regular events?

e.g.
aBox when: TRExtentChanged do: [ :event | (self parentFor: aBox) rebuild ]

Is there benefit in having some events as events and some as callbacks? Isn't event more versatile?

What do you think?

I should probably check how this is done in Bloc...

Peter
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal callbacks as events

Peter Uhnak
Instead of (or alongside) a callback

anElement addCallback: (TRExtentCallback block: [ :event | "do something" ])

have an event

anElement when: TRExtentChanged do: [ :event | "do something" ]

While it looks like a subtle difference it's more versatile and doesn't introduce a different way to do things, when we already perfectly feasible way in pharo - Announcements.

And I am asking what do you think about such proposition.

Cheers,
Peter


On Mon, Jul 27, 2015 at 10:03 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Peter,

I do not know whether this is the jetlag effect or not, but I do not understand your email.

What do you mean that a callback be attached just like regular event? 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 27, 2015, at 6:55 AM, Peter Uhnák <[hidden email]> wrote:

Hi,

this is just an idea that's been bugging me for some time...
what if callbacks could be attached just like regular events?

e.g.
aBox when: TRExtentChanged do: [ :event | (self parentFor: aBox) rebuild ]

Is there benefit in having some events as events and some as callbacks? Isn't event more versatile?

What do you think?

I should probably check how this is done in Bloc...

Peter
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal callbacks as events

abergel
This make sense yes.
I did this at the beginning because I was afraid of the overhead due to the event.

Indeed, it would make sense to have events only.

Alexandre


> On Jul 27, 2015, at 6:51 PM, Peter Uhnák <[hidden email]> wrote:
>
> Instead of (or alongside) a callback
>
> anElement addCallback: (TRExtentCallback block: [ :event | "do something" ])
>
> have an event
>
> anElement when: TRExtentChanged do: [ :event | "do something" ]
>
> While it looks like a subtle difference it's more versatile and doesn't introduce a different way to do things, when we already perfectly feasible way in pharo - Announcements.
>
> And I am asking what do you think about such proposition.
>
> Cheers,
> Peter
>
>
> On Mon, Jul 27, 2015 at 10:03 PM, Alexandre Bergel <[hidden email]> wrote:
> Hi Peter,
>
> I do not know whether this is the jetlag effect or not, but I do not understand your email.
>
> What do you mean that a callback be attached just like regular event?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>> On Jul 27, 2015, at 6:55 AM, Peter Uhnák <[hidden email]> wrote:
>>
>> Hi,
>>
>> this is just an idea that's been bugging me for some time...
>> what if callbacks could be attached just like regular events?
>>
>> e.g.
>> aBox when: TRExtentChanged do: [ :event | (self parentFor: aBox) rebuild ]
>>
>> Is there benefit in having some events as events and some as callbacks? Isn't event more versatile?
>>
>> What do you think?
>>
>> I should probably check how this is done in Bloc...
>>
>> Peter
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal callbacks as events

Offray
In reply to this post by Peter Uhnak
Peter, I like your proposed syntax. Seems more understandable (but I don't know nothing about announcements).

Cheers,

Offray

On 27/07/15 16:51, Peter Uhnák wrote:
Instead of (or alongside) a callback

anElement addCallback: (TRExtentCallback block: [ :event | "do something" ])

have an event

anElement when: TRExtentChanged do: [ :event | "do something" ]

While it looks like a subtle difference it's more versatile and doesn't introduce a different way to do things, when we already perfectly feasible way in pharo - Announcements.

And I am asking what do you think about such proposition.

Cheers,
Peter


On Mon, Jul 27, 2015 at 10:03 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Peter,

I do not know whether this is the jetlag effect or not, but I do not understand your email.

What do you mean that a callback be attached just like regular event? 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 27, 2015, at 6:55 AM, Peter Uhnák <[hidden email]> wrote:

Hi,

this is just an idea that's been bugging me for some time...
what if callbacks could be attached just like regular events?

e.g.
aBox when: TRExtentChanged do: [ :event | (self parentFor: aBox) rebuild ]

Is there benefit in having some events as events and some as callbacks? Isn't event more versatile?

What do you think?

I should probably check how this is done in Bloc...

Peter
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal callbacks as events

Peter Uhnak


On Mon, Aug 3, 2015 at 11:36 PM, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
Peter, I like your proposed syntax. Seems more understandable (but I don't know nothing about announcements).

Announcements are Pharo's event system.... and I am kind of surprised that there is no chapter about it in neither Pharo books. Because it definitely should be there.
Unfortunately I have no idea where I learned announcements (quite possibly from exploring code), maybe this could help http://pharo.gemtalksystems.com/book/LanguageAndLibraries/announcements/ or google, sorry. :(


 

Cheers,

Offray


On 27/07/15 16:51, Peter Uhnák wrote:
Instead of (or alongside) a callback

anElement addCallback: (TRExtentCallback block: [ :event | "do something" ])

have an event

anElement when: TRExtentChanged do: [ :event | "do something" ]

While it looks like a subtle difference it's more versatile and doesn't introduce a different way to do things, when we already perfectly feasible way in pharo - Announcements.

And I am asking what do you think about such proposition.

Cheers,
Peter


On Mon, Jul 27, 2015 at 10:03 PM, Alexandre Bergel <[hidden email][hidden email]> wrote:
Hi Peter,

I do not know whether this is the jetlag effect or not, but I do not understand your email.

What do you mean that a callback be attached just like regular event? 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 27, 2015, at 6:55 AM, Peter Uhnák <[hidden email]> wrote:

Hi,

this is just an idea that's been bugging me for some time...
what if callbacks could be attached just like regular events?

e.g.
aBox when: TRExtentChanged do: [ :event | (self parentFor: aBox) rebuild ]

Is there benefit in having some events as events and some as callbacks? Isn't event more versatile?

What do you think?

I should probably check how this is done in Bloc...

Peter
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal callbacks as events

Offray
Peter,

Thanks for the pointer to docs. Surely necessity will drive to announcements when develop my project. So far I have not an explicit need from that, but your pointers will be my unconscious waiting to be needed. Anyway, using announcements the syntax is clearer.

Cheers,

Offray

On 03/08/15 17:18, Peter Uhnák wrote:


On Mon, Aug 3, 2015 at 11:36 PM, Offray Vladimir Luna Cárdenas <[hidden email]> wrote:
Peter, I like your proposed syntax. Seems more understandable (but I don't know nothing about announcements).

Announcements are Pharo's event system.... and I am kind of surprised that there is no chapter about it in neither Pharo books. Because it definitely should be there.
Unfortunately I have no idea where I learned announcements (quite possibly from exploring code), maybe this could help http://pharo.gemtalksystems.com/book/LanguageAndLibraries/announcements/ or google, sorry. :(


 

Cheers,

Offray


On 27/07/15 16:51, Peter Uhnák wrote:
Instead of (or alongside) a callback

anElement addCallback: (TRExtentCallback block: [ :event | "do something" ])

have an event

anElement when: TRExtentChanged do: [ :event | "do something" ]

While it looks like a subtle difference it's more versatile and doesn't introduce a different way to do things, when we already perfectly feasible way in pharo - Announcements.

And I am asking what do you think about such proposition.

Cheers,
Peter


On Mon, Jul 27, 2015 at 10:03 PM, Alexandre Bergel <[hidden email]> wrote:
Hi Peter,

I do not know whether this is the jetlag effect or not, but I do not understand your email.

What do you mean that a callback be attached just like regular event? 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 27, 2015, at 6:55 AM, Peter Uhnák <[hidden email]> wrote:

Hi,

this is just an idea that's been bugging me for some time...
what if callbacks could be attached just like regular events?

e.g.
aBox when: TRExtentChanged do: [ :event | (self parentFor: aBox) rebuild ]

Is there benefit in having some events as events and some as callbacks? Isn't event more versatile?

What do you think?

I should probably check how this is done in Bloc...

Peter
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Roassal callbacks as events

abergel
In reply to this post by Offray
This is something we will work on.  

Alexandre 



Le 3 août 2015 à 18:36, Offray Vladimir Luna Cárdenas <[hidden email]> a écrit :

Peter, I like your proposed syntax. Seems more understandable (but I don't know nothing about announcements).

Cheers,

Offray

On 27/07/15 16:51, Peter Uhnák wrote:
Instead of (or alongside) a callback

anElement addCallback: (TRExtentCallback block: [ :event | "do something" ])

have an event

anElement when: TRExtentChanged do: [ :event | "do something" ]

While it looks like a subtle difference it's more versatile and doesn't introduce a different way to do things, when we already perfectly feasible way in pharo - Announcements.

And I am asking what do you think about such proposition.

Cheers,
Peter


On Mon, Jul 27, 2015 at 10:03 PM, Alexandre Bergel <[hidden email][hidden email]> wrote:
Hi Peter,

I do not know whether this is the jetlag effect or not, but I do not understand your email.

What do you mean that a callback be attached just like regular event? 

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jul 27, 2015, at 6:55 AM, Peter Uhnák <[hidden email]> wrote:

Hi,

this is just an idea that's been bugging me for some time...
what if callbacks could be attached just like regular events?

e.g.
aBox when: TRExtentChanged do: [ :event | (self parentFor: aBox) rebuild ]

Is there benefit in having some events as events and some as callbacks? Isn't event more versatile?

What do you think?

I should probably check how this is done in Bloc...

Peter
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev