On Thu, Jul 3, 2008 at 10:28 PM, Ryan Gahl <[EMAIL PROTECTED]> wrote:

> Why are you calling
>> shared instance members (where member is property/method) "static"?
>
>
> Sorry, that's not what I meant to say. If you read my blog post (
> http://www.someelement.com/2007/03/multiple-inheritance-with-prototypejs.html)
> - I explain what I mean by "prototype-static".
>
> Ok, let's look at your example:
>
> // constructor
>> function Person(name) {
>>  this.name = name;
>>  Person.count++;
>> };
>>
>> // static property (defined directly on a constructor)
>> Person.count = 0;
>>
>> // shared instance method
>> Person.prototype.say = function(message) {
>>  return this.name + ' says: ' + message;
>> }
>
>
> (btw, you forgot a semicolon there  - and yes I'm pedantic when it comes to
> missing semicolons :))
>

<sigh> If you only knew HOW pedantic... :-D

>
> So... what I mean by "prototype static" is the fact that after that last
> line it is now possible to call "Person.prototype.say("blah")" statically
> (i.e. without having an instance) -- and of course get an error. What I mean
> by "instance only" members, is any member that is ONLY visible from
> instances, period. And of course true private variables and methods is
> another thing I was talking about.
>
> meh... nevermind :)
>
>
>
> >
>


-- 
Jerod Venema
Senior Software Engineer
Nth Penguin, LLC
http://www.nthpenguin.com
(919) 368-5105
---
WebWidgetry.com / MashupStudio.com
Future Home of the World's First Complete Web Platform

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to