From: Keith Gaughan Date: 2006-07-29T06:01:43+09:00 Subject: Re: does ":" have an anolog in another language? On Sat, Jul 29, 2006 at 03:40:11AM +0900, Ike wrote: > does the colon operator have an anolog in say, Java or C++ ? It seems to be > a reference pointer. Am i mistaken in assuming this? Thanks, Ike As mentioned elsewhere, Smalltalk and Lisp have operators which allow you to do this, but seeing as nobody's mentioned Prolog, I thought I would. Atoms (which is the Prolog equivalent) aren't normally introduced by or wrapped by anything. They're determined by their form, i.e., an alphanumeric string that starts with a lowercase letter. thisIsAnAtom would be an example of an atom. Variables in Prolog start with an uppercase letter, so ThisIsAVariable would be a variable. If the atom contains non-alphanumeric characters or starts with a number or uppercase letter, it needs to be wrapped in single quotes, so '123' would be an atom, as would 'CHUNKY BACON!' and 'zing! zoop!'. Strings are wrapped in double quotes. What the colon operator introduces are a special form of string. Unlike regular strings, they're immutable and there's only ever one copy of it in memory. All objects in Ruby are passed around as references, so yeah, you're in error in that regard, though it's understandable. K. -- Keith Gaughan - kmgaughan@eircom.net - http://talideon.com/ Luck can't last a lifetime, unless you die young. -- Russell Banks