[Pharo-users] Use cases for methods with optional parameters

Cyril Ferlicot D. cyril.ferlicot at gmail.com
Wed Jan 20 12:40:39 EST 2016


Le 20/01/2016 16:08, Damien Cassou a écrit :
> Hi,
> 
> I would like to study the impact of adding optional parameters to
> keyword methods in Pharo. The goal of optional parameters is to
> facilitate the implementation of methods where some parameters are
> optional. For example, Seaside has:
> 
> WAComponent>>request: aRequestString label: aLabelString
>              default: aDefaultString onAnswer: aBlock
> 
>     ...
> 
> This method of 4 arguments has only 1 required argument (aRequestString)
> and 3 optional ones. In the current implementation, this results in 7
> additional methods that only delegate directly or indirectly to the one
> above:
> 
> - request:
> - request:default:
> - request:default:onAnswer:
> - request:label:
> - request:label:default:
> - request:label:onAnswer:
> - request:onAnswer:
> 
> Before starting to implement anything, I need to know if it makes sense.
> If you want to help me, please send me all the use cases you have by
> giving me:
> 
> - the library name (and URL if not in Catalog), or "pharo" if it's in
>   Pharo
> - the class where this happens
> - the range of selectors that make sense
> 
> For the example above, this would be:
> 
> - Seaside
> - WAComponent
> - request:*
> 
> 
> Thank you very much
> 

Hi Damien,

There is a lot of optional parameters in the UIManager.

Package: UIManager (pharo)

Classes: UIManager and subclasses

Selectors:

- chooseFrom:*
- reguest:*
- …

Almost all the methods have optional parameters.

-- 
Cyril Ferlicot

http://www.synectique.eu

165 Avenue Bretagne
Lille 59000 France

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/attachments/20160120/75a557ba/attachment.asc>


More information about the Pharo-users mailing list