Hi Ed,
This is tricky because some of the UI backends define methods on the old
accessors, eg Cocoa:
TUPLE: pasteboard handle ;
C: <pasteboard> pasteboard
M: pasteboard clipboard-contents
pasteboard-handle pasteboard-string ;
M: pasteboard set-clipboard-contents
pasteboard-handle set-pasteboard-string ;
I think the right approach here is to add a pair of generic words,
GENERIC: clipboard-contents ( clipboard -- string )
GENERIC: set-clipboard-contents ( string clipboard -- )
And two methods for the default implementation,
M: clipboard clipboard-contents contents>> ;
M: clipboard set-clipboard-contents (>>contents) ;
Be on the lookout for accessors which have other methods defined on them.
I'd rather these accessors remained with the 'old style' names, and had
methods to read/write the slot defined on them as above, rather than the
Cocoa UI backend placing methods on contents>> and (>>contents).
The help system is the same; there's an article tuple with a contents slot,
but a few different data types have methods on article-contents.
So in general, you can only replace foo-bar with bar>> if \ foo-bar
see-methods shows no other methods.
Slava
On Fri, Aug 29, 2008 at 3:46 PM, Eduardo Cavazos <[EMAIL PROTECTED]>wrote:
> Slava,
>
> The "clipboard-protocol" help article mentions the old
> accessors 'clipboard-contents' and 'set-clipboard-contents' directly. My
> guess is that I can mention the 'contents>>' method/accessor instead. But
> what about the setter? Should I mention the '(>>contents)' generic? It
> doesn't seem right to give instructions to override '>>contents' since it's
> not a generic. On the other hand, I thought the '(>>contents)' style
> setters
> were considered sort of "behind the scenes". Perhaps for a case like this
> where you're extending the protocol, it makes sense to talk about this sort
> of behind the scenes stuff.
>
> Ed
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Factor-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk