Welcome Guest Search | Active Topics | Log In | Register

public and private and protected members
#1 Posted : Monday, July 10, 2006 11:39:41 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 8/16/2005(UTC)
Posts: 311

Thanks: 18 times
Was thanked: 18 time(s) in 14 post(s)
Hi, just curious if it is possible to add "public", "protected" and "private" members to Squirrel classes as common in other C++-style languages.  Will this impact performance visibly?
#2 Posted : Tuesday, July 11, 2006 3:31:11 AM(UTC)
Rank: Advanced Member

Groups: Registered, Administrators
Joined: 6/11/2005(UTC)
Posts: 1,059

Thanks: 0 times
Was thanked: 79 time(s) in 61 post(s)
Well, depends. Would be a couple of 'if' for each 'fetch' against classes for enforcing private and public. For protected, would mean recursively traverse the inheritance tree that is quite heavy.

Personally I'm not a big supporter of incapsulation using private etc... you can see it from Squirrel's VM code. So I wouldn't bother. In my project that has a quite big code base written in squirrel, we simply prefix private methods and fields with _ . So far nobody has accidentally called a private method :) .

I'll give it some thought.


Follow me on Twitter @squirrellang
#3 Posted : Wednesday, November 19, 2014 2:13:07 PM(UTC)
Rank: Member

Groups: Registered
Joined: 4/24/2012(UTC)
Posts: 25
Location: Netherlands

Thanks: 3 times
Was thanked: 0 time(s) in 0 post(s)
Hi there,

Is there an update on this? I personally would be very happy if we could somehow enforce certain methods (and variables) to be NOT publicly exposed. Obviously without affecting the performance too much (could it be done at compile time?).


Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Clean Slate theme by Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.067 seconds.