A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Languages
»
Ruby
Author
(ruby) variables with colons in front
Pho Tek
Ranch Hand
Joined: Nov 05, 2000
Posts: 757
I like...
posted
Aug 18, 2008 22:24:00
0
Are there any specific convention with regards to variable naming in Ruby?
I was looking at some rake tasks and was led to believe that their names have a colon in front because it is an internal DSL (according to Fowler).
Then I took a look at
this
; and variables with colon prefixes are everywhere.
Please enlighten me.
Thanks
Pho
Mike Simmons
Ranch Hand
Joined: Mar 05, 2008
Posts: 2816
2
posted
Aug 19, 2008 13:33:00
0
In Ruby, an identifier that begins with a colon is a
symbol
.
Pho Tek
Ranch Hand
Joined: Nov 05, 2000
Posts: 757
I like...
posted
Aug 19, 2008 20:40:00
0
Thank you. So Symbols are basically interned Strings in
java
.
Regards,
Pho
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4725
I like...
posted
Aug 20, 2008 07:36:00
0
Originally posted by Pho Tek:
Thank you. So Symbols are basically interned Strings in java.
Exactly.
A good workman is known by his tools.
I agree. Here's the link:
http://aspose.com/file-tools
subject: (ruby) variables with colons in front
Similar Threads
How to use Ruby to write an http test client?
Java Rules Round #154
Class diagram and Sequence Diagram -- Connection
can't compile .java file
Slashdot claims twitter is moving to Scala
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter