In this Java example, a and b are statically typed to be of type Object.
Both Strings and Arrays descend from Object. (And primatives like
integers and the like will be autoboxed into descendants of Object).
···
On Tue, 18 Sep 2007 18:02:59 -0400, Lew wrote:
Summercool wrote:
when a writing or a book reads "a is a Hash object; a is an Array
object; or a is an Animal object" it is just a short form to say that
"a is a reference to that object."
b = a means "whatever a is referencing to, now b is referencing it
too".
so that's why a[1] = "foobar" will change what b will display, but a
= "foobar" will not change what b will display.
You can't do both in Java. Is a an array or a String? If a is a String
and b is an array, then neither `a = b' nor `b = a' will compile in
Java.
Java is a strongly-typed, compiled language which means it does more
static type checking and thus would reject treating a as both an array
and a String.
In that environment the programmer must choose one or the other.
--
Ken Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology. http://www.iit.edu/~kbloom1/
Perhaps 'special' was not the right term. I didn't mean to
suggest that the behavior was unique to those classes just that
they had that particular property.
Gary Wright
···
On Sep 18, 2007, at 11:46 PM, Rick DeNatale wrote:
The only thing special about Ruby's 'primitive' classes is that they
behave such that identity is isomorphic to equality. That is to
say that a.equal?(b) if and only iff (a == b).
Actually that's not really special, it's true of any object which
hasn't overriden Object#==
On 9/18/07, Rick DeNatale <rick.denatale@gmail.com> wrote:
As a long-time observer and contributor to this forum, I've got to say
that this subtle distinction between variables and objects has tripped
up more than it's fair share of newbies. It might well be the #1
stumbling block for many ruby learners. Not to mention other similar
languages.
Care to post details on why you think we need another Rails CMS and why the
current ones (e.g. Radiant) are not sufficient?
Jason
···
On 9/19/07, Ajay Maurya <amaurya@brickred.com> wrote:
Hi All
We have started a Open Source CMS Project based on Ruby on Rails . We
are looking volunteers for admin, developer, senior developer , web
Designer roles .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Q: What do you get when you cross the Godfather with an attorney?
A: An offer you can't understand.
Nah, this dude's all right, so far. As if my opinion mattered.
Stay with it, Summercool. It's what discussion groups are for.
Here's why the reaction: cross-posting of computer-science-type essays,
something Xah Lee does. But he recycles all his decades-old crap and really
doesn't participate in the discussion. This isn't that at all.
I fully agree and I didn't in any way mean to compare Summercool to Xah
Lee. My apologies to Summercool if anyone interpreted it that way.
Since Summercoool is most likely Xah Lee, the comparison is fair. The
post has been spammed to all the news groups--as usual.
Java is a strongly-typed, compiled language which means it does more
static type checking and thus would reject treating a as both an array
and a String.
In that environment the programmer must choose one or the other.
Ken Bloom wrote:
In this Java example, a and b are statically typed to be of type Object. Both Strings and Arrays [sic] descend from Object. (And primatives [sic] like integers and the like will be autoboxed into descendants of Object).
That doesn't make Strings and arrays assignment compatible, and besides, it isn't so.
It was not stated by the OP that they were statically typing the variable to Object. In fact, their example used a type "Animal". They also used the syntax "a[1]", which is not possible in Java with a variable of type Object. So clearly a and b are /not/ statically typed to Object.
Unless you meant "/if/ a and b are statically typed [to] Object" that the assignment will work, which is true but of sharply limited usefulness.
In that case, you are a) defeating Java's type system and b) not getting the benefit of the Stringness or arrayness of the variable. This is in contrast to the dynamically-typed languages wherein the variable will behave like an object of the runtime type, unlike in Java.
Back to the OP's example:
Summercool wrote:
so that's why a[1] = "foobar" will change what b will display, but a = "foobar" will not change what b will display.
Again, this cannot be done in Java. The same variable a cannot be set to a String and still be used with array syntax.
I feel I should add, also, that another big stumbling block for people
new to the language is how scope is handled. It's made pretty clear
in the pickaxe, but is oftentimes lost to the new developer while they
sit in front of the screen.
Todd
···
On 9/20/07, Todd Benson <caduceass@gmail.com> wrote:
On 9/18/07, Rick DeNatale <rick.denatale@gmail.com> wrote:
> As a long-time observer and contributor to this forum, I've got to say
> that this subtle distinction between variables and objects has tripped
> up more than it's fair share of newbies. It might well be the #1
> stumbling block for many ruby learners. Not to mention other similar
> languages.
Radiant is not active or has very slow development cycle . furthermore
I dont think radiant has cutting cutting edge .
A RoR based cms can have fast development cycle with many features in
it
Radiant is very good and powerful cms system but We need more than that
that's why we started the Great Ruby cms (TGRCMS).
Thanks
- jeet
···
On Thu, 2007-09-20 at 00:20 +0900, Jason Roelofs wrote:
On 9/19/07, Ajay Maurya <amaurya@brickred.com> wrote:
>
>
> Hi All
>
>
> We have started a Open Source CMS Project based on Ruby on Rails . We
> are looking volunteers for admin, developer, senior developer , web
> Designer roles .
>
>
> project name = The Great Ruby cms
> (TGRCMS)
>
> project page : http://rubyforge.org/projects/tgrcms/
>
>
> Interested? Join us
>
>
> Mail us at = dumpe2fs at gmail com
>
>
>
> Cheers
>
> Ajay Maurya
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Q: What do you get when you cross the Godfather with an attorney?
> A: An offer you can't understand.
Care to post details on why you think we need another Rails CMS and why the
current ones (e.g. Radiant) are not sufficient?
Radiant is not active or has very slow development cycle . furthermore
I dont think radiant has cutting cutting edge
John, Daniel, and Sean are very active on the Radiant list, and a significant new functionality was added to trunk this week. So I'm not sure where you got the notion that it wasn't active.
A RoR based cms can have fast development cycle with many features in
it
Radiant runs on rails
Radiant is very good and powerful cms system but We need more than that
that's why we started the Great Ruby cms (TGRCMS).
Which comes back to the original question, what exactly are you going to be doing differently? At the moment the only suggestion seems to be more active development, which in reality is difficult to sustain over an extended period. If that is the only point of difference, then personally I think efforts would be better spent improving and adding to one of the existing solutions out there rather than re-inventing the same thing all over again.