private variables 
Author Message
 private variables

Quote:


>>Private methods and class-local instance variables are quite different.
>>If you use a private method, you get an exception. If you try to use
>>a class-local instance variable then you just use another variable,
>>which could lead to obscure bugs.
>>So I think punctuation (and it should be as short as possible)
>>is a much better option.

> If you try to use a class-local instance variable and it has not yet
> been initialized, I would expect to see a warning when you run with ruby
> -w, just like you get now with regular instance variables.

> Paul

I often initialize instance variables conditionally. (That is, on first use).


Sat, 05 Mar 2005 01:13:37 GMT  
 private variables

Quote:

> Did you ever find out how far from the SEA airport
> to the conference center and hotel?

It's about 14 miles:

http://maps.yahoo.com/py/
ddResults.py?proceed=Proceed&Pyt=Tmap&tarname=&tardesc=&newname=Seattle+
Tacoma+International+Airport&newdesc=&newHash=662400403&newTHash=-
629074884&newSts=&newTSts=&newFL=Use+Address+Below&newaddr=SEA&newcsz=Se
attle%2C+WA&newcountry=us&newTFL=Use+Address+Below&newtaddr=8th+and+Pike
&newtcsz=Seattle%2C+WA&newtcountry=us&Submit=Get+Directions

(UGLY URL!)

Please note that the destination address is approximate. It's an  
intersection near the convention center. Any taxi will know it by name.  
A taxi will be your most expensive option (about $40-$50???) but is  
readily available outside baggage claim.

Also, there is also the 194 bus that runs very frequently and during  
the weekday goes through the city's bus tunnel. The last stop going  
north puts you at the Convention Center stop. It's also the last stop  
in the tunnel. Cost: $1.25-$2.50. Check  
http://transit.metrokc.gov/bus/flymetro.html for exact details.

Finally (out of my reccomendations), there is shuttle express, which  
you can get to by going to the parking garage outside the Sea-Tac  
airport and going to the 3rd level. There should be  signs for it. They  
cost $22 door-to-door, run very very often any hour of the day, and (at  
least going TO the airport) the second person is free. So gang up w/ a  
fellow rubiest and split the cost!



Sat, 05 Mar 2005 01:17:26 GMT  
 private variables
Hi --


Quote:
> Hi --


> > David:

> > Did you ever find out how far from the SEA airport
> > to the conference center and hotel?

> No....  Can I punt this to the Seattle crowd?  (Hey,
> Seattle crowd, wake up -- it's 9:00 :-)  I'll try to
> look it up if they don't respond quickly.

OK, I guess they're asleep :-)

The airport is 13 miles south of downtown Seattle, and travel to
downtown (depending on means) takes 25-45 minutes.

Thus spake
<http://meetings.sixcontinentshotels.com/destinations/seattle/transpor...>.

David

--
David Alan Black                      | Register for RubyConf 2002!


Web:  http://pirate.shu.edu/~blackdav | http://www.rubyconf.com



Sat, 05 Mar 2005 01:26:10 GMT  
 private variables
a private instance variable is one that is not inheritable. is that the
only difference?


want to use _ in front of all my local variables, which take me back to
my old idea of using % for regular locals: then all variables would have
a puncutation mark in front of them.

  $ - global



  % - local

but % smacks of code breakage, unless it were optional.

what about using parentheticals instead? since currently it is pointless

just a thought.

-tom

Quote:

> Hi,

> In message "Re: private variables"

> |Are we dead set against "attr_private" ?
> |
> |   class Foo
> |  attr_private :bar
> |   end
> |
> |?

> I'm not going to choose attr_private (unless someone put some idea in
> my brain), because

>   a) we need static information about class local instance variable at
>      compile time.  Dynamic attr_priate at run time is too late.

>   b) if we choose attr_private (by making it a syntax), we need to
>      search for declaration to distinguish whether a instance variable
>      is class local or not.  I don't feel it's a Ruby Way (tm).

>                                                    matz.

--
tom sawyer, aka transami



Sat, 05 Mar 2005 01:49:45 GMT  
 Ruby Conf
It's about 30 minutes call it 15 miles.  SeaTac airport is in a suburb to
the south, and the conference center and hotels are in central Seattle.

-pate

Quote:

> David:

> Did you ever find out how far from the SEA airport
> to the conference center and hotel?

> Thanks

> --
> Jim Freeze
> ----------
> Programming Ruby
>  def initialize; fun; end
> A language with class



Sat, 05 Mar 2005 09:48:18 GMT  
 Ruby Conf

Quote:
> Well, "%" is also used in Perl as a modulus operator, and its use
> with variables is fine there.

Well, the meaning of 'foo % bar' depends on whether foo has been
defined as 'sub foo' or 'sub foo()' :-)

--
  __("<      Marcin Kowalczyk

   ^^    http://qrnik.knm.org.pl/~qrczak/



Sat, 05 Mar 2005 22:07:37 GMT  
 Ruby Conf
Oh, yes, yes, but the distinction between 'foo % bar' and 'foo %bar' is
clear in Perl, isn't it, independent of the definition of foo?

Regards,

Bill
===========================================================================

Quote:

>> Well, "%" is also used in Perl as a modulus operator, and its use
>> with variables is fine there.
> Well, the meaning of 'foo % bar' depends on whether foo has been
> defined as 'sub foo' or 'sub foo()' :-)
> --
>   __("<      Marcin Kowalczyk

>    ^^    http://qrnik.knm.org.pl/~qrczak/



Sat, 05 Mar 2005 22:29:21 GMT  
 Ruby Conf

Quote:
> Oh, yes, yes, but the distinction between 'foo % bar' and 'foo %bar' is
> clear in Perl, isn't it, independent of the definition of foo?

No, both can mean either foo(%bar) or foo() % bar(), depending on
the definition of foo.

--
  __("<      Marcin Kowalczyk

   ^^    http://qrnik.knm.org.pl/~qrczak/



Mon, 07 Mar 2005 19:22:27 GMT  
 Ruby Conf

Quote:
> |Are we dead set against "attr_private" ?
> |
> |   class Foo
> |  attr_private :bar
> |   end
> |
> |?

> I'm not going to choose attr_private (unless someone put some idea in
> my brain), because

>   a) we need static information about class local instance variable at
>      compile time.  Dynamic attr_priate at run time is too late.

>   b) if we choose attr_private (by making it a syntax), we need to
>      search for declaration to distinguish whether a instance variable
>      is class local or not.  I don't feel it's a Ruby Way (tm).

Hrm, this thread has been so huge that I've been in skim mode. I
understand that attr_private wouldn't work because its dynamic and
determined at runtime, but I'm wondering if there isn't another single
character that could be used in the grammar to designate a private
instance variable.  I couldn't think of any without there being some
kind of compile time declaration of a symbol...  but there doesn't
seem like there's any way of providing compile time hints outside of
the special characters that get prepended to a symbol name.  Just a
thought, but would it be possible to introduce a compile time syntax
for providing hints to the compiler?  If so, then that'd likely open
up possibilities for other naming schemes.  ::shrug:: Just my $0.02.
-sc

--
Sean Chittenden



Sun, 13 Mar 2005 03:16:00 GMT  
 Ruby Conf
Hi,


Regards,

Bill
==========================================================================
(deleted)

Quote:
> instance variable.  I couldn't think of any without there being some
> kind of compile time declaration of a symbol...  but there doesn't
> seem like there's any way of providing compile time hints outside of
> the special characters that get prepended to a symbol name.  Just a
> thought, but would it be possible to introduce a compile time syntax
> for providing hints to the compiler?  If so, then that'd likely open
> up possibilities for other naming schemes.  ::shrug:: Just my $0.02.
> -sc
> --
> Sean Chittenden



Sun, 13 Mar 2005 03:41:48 GMT  
 
 [ 88 post ]  Go to page: [1] [2] [3] [4] [5] [6]

 Relevant Pages 
 

 
Powered by phpBB® Forum Software