[F-Script-talk] Re: make an alias
Brought to you by:
pmougin
From: Philippe M. <pm...@ac...> - 2002-05-03 12:03:26
|
Hi Bob, You can't really make an alias for a message send using F-Script. However, what you can do to avoid retyping a lengthy sequence of code is to factorize it in a block. For instance, here is a block that will send your specific "inspectWith:" message to the provided argument. ins := [:inpectedObject | inspectedObject inspectWith:{#name, #address, #salary}] You can then execute the block by sending it a "value" message and providing the required argument. For example: ins value:(P at:P address = 'PARIS') Best, Phil ----- Original Message ----- From: bob ackerman To: f-s...@li... Sent: Thursday, May 02, 2002 5:48 AM Subject: [F-Script-talk] make an alias i saw a nice command in the tutorial: inspectWith:{#name, #address, #salary} so i tried it with another command: (P at:P address = 'PARIS') inspectWith:{#name, #address, #salary} and it worked. good. so i thought it would be nice to have an alias for it. but i couldn't figure out how. i tried putting it in a block: ins := [inspectWith:{#name, #address, #salary}] but that didn't work. any way to make an alias for it? |