Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: FFI, pragma and co...: msg#00200

lang.smalltalk.squeak.beginners

Subject: Re: FFI, pragma and co...

Symbol>>isDescriptionSelector
"Answer wheter the receiver is a method selector following the naming
conventions of a description selector."
^ self ~= #description
and: [ self beginsWith: #description ]


This is a solution. But sometime, you would like to start a method with
'description' and this should not be a description method (or you do it
by mistake).

Pragmas can be used to solve this problem. You then will annotate your
method to tell the system that this methods are description methods. You
do it like this:

MyObject class>>firstName
<description>
^ MAStringDescription auto: 'firstName' label: 'First name'



yes that's why I fiind that interesting.. clearer


Then, when you want to collect all the description methods in a class,
you will use the methods in the protocol 'finding' of the Pragma class
(class side).

Pragma allNamed: #description in: yourObject class

This returns a collection of Pragmas (compiled methods, selector and
class) in which the pragma #description has been used in the class of
yourObject.

this is cool ;) I'm manipulating them a bit right now



Is it clear ?

yes more thanks ;)


> beacause I use getters and setters for my iv :)


And pragmas won't help you in my opinion, I don't see any relation :-)
Why don't you want getters and setters ?

yes I wasn't clear. But as accesors are methods, I can use pragma to
tag indirectly my instance variable. Just an idea of somethink that
can be useful to me.
I trying to make a kind of (small) knowledge management system, maybe
more a kind of case based reasoning tool (ie. entities are composed of
attributes or descriptors upon which the system reason..) and one
simple solution for me is to directly use instance variables for these
descriptors (and then I can tag to process them)...

I'm trying to see all kind of solution I could choose... even if right
now I'm more trying to use dedicated Descriptor class...

I think one of the limitation I have (but I'll probably open a post on
that one day) is that I need attributes as first-class entities and
instance variable are not (are they ?)



Hope this is your last question of the day, I already answered 4 of them
and I'm tired now :-D

this was ;) I have days like that :d

Squeak REALLY rocks

Cédrick
_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe