The Artima Developer Community
Sponsored Link

Agile Buzz Forum
What is there to a name?

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
What is there to a name? Posted: Nov 28, 2007 2:15 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: What is there to a name?
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

Well, if you're talking about named instance variables in Smalltalk, not much.

The other night, I had a zany idea about instance variables. This blog is not about that. I haven't realized said zany idea, yet. As I looked at it, I found that I really wanted real world objects to represent and reify those slots that are defined in ClassDescription. The current implementation is just an array of strings. Any reflection about a classes instance variables is done through APIs on the Class (things like indexOfInstVar: 'foobar', etc). But no real objects to represent and reflect about instance variables directly.

It seemed like it might be fun to build such a thing and then explore what we could do with them. I also missed doing some ground up, test focused, development. So I sat down and wrote some tests. Then I used the debugger to fill out the code. After 6 tests and some code, I can ask a class for its namedSlots. It answers back a collection of NamedSlot objects. There's not much to them right now. They're kind of like CompiledMethods, an mclass and a name. You can ask one for its index.

If all goes as planned, I'll try to explore what can be done with these in the next few days. The code for just this little bit is published as NamedSlots and NamedSlotsTests. Feel free to follow along.

Smalltalk is one of the only languages out there that not only has really rich reflection, but actually allows you to add more to it.

Read: What is there to a name?

Topic: There's a hole in your side of the boat Previous Topic   Next Topic Topic: Web 2.0 and Fashion

Sponsored Links



Google
  Web Artima.com   

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