The Artima Developer Community
Sponsored Link

Agile Buzz Forum
How Valuable is a Symbol?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
How Valuable is a Symbol? Posted: Jun 12, 2004 9:42 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: How Valuable is a Symbol?
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog

Advertisement
A week's journey through some extensions to the base. There are more. We could go on for a while, but I'll give it a rest (at least until I hit a week where I can't come up with anything). I thought it would be fitting at the close to submit "The Simplest Little Extension that Could Possibly make a Big Difference." Here's the code:

Symbol "i'd put those standard 2x greater than things in here, but that doesn't seem to work"
	value: anObject
	^anObject perform: self

That's it. That's all there is. I didn't even write any tests. Nor can I take any credit. I was clued into this one by Brant and Roberts (of Refactoring Browser fame) who told me they got it from Ward Cunningham (of Wiki fame). If it has more lineage than that, I'd love to here it.

I love this extension (and I've lauded its wonderfulness on many occasions), because it has the ability to affect so much, with so few characters. What the extension does is allow to replace just about any thing that looks like:

[:each | each unaryMessage]

with

#unaryMessage

There is a tendency to look at this and say that sounds cool, but I don't think I'll use it. It's outside of the standard smalltalk language domain and I'm worried there might be some adverse effects if I use it. We've been using it in LOTS of code at Key for 3+ years now. Nothings gone wrong yet. I dare others to try it and prove me wrong. See if being able to treat collection do:/reject:/select:/collect:/anySatisfy:/allSatisfy:/detect:/ like "attribute" queries doesn't cause you to spend less time typing extra characters and worry about your problem more.

SymbolValue is a package in the Open Repository that adds this.

The five standard bundles, have 761 candidates for this kind of replacement. Want to see where you can use it in your code? Select the appropriate method(s)/protocol(s)/class(es)/package(s). Select the rewrite tab, and enter

[:`arg | `arg `message]

in the search pane, then slap the search button.

Read: How Valuable is a Symbol?

Topic: Why email is broken Previous Topic   Next Topic Topic: Agile Handover

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use