Feature Requests: Browse | Submit New | Admin

[#28764] node comparison?

Date:
2010-12-04 01:51
Priority:
3
Submitted By:
Guten (gutenlinux)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
node comparison?

Detailed description
use below tree for example.
------
root
 a
  a
------
 
root = Tree::TreeNode.new "root"
root << Tree::TreeNode.new("a") << Tree::TreeNode.new("a")

current <=> is use #name, so root["a"] == root["a"]["a"], but they are diffenent
nodes.

== use node comparison.

root["a"] is same as root["a"] 
root["a"]["a"] is not same as root["a"] 
root is ancesotor of root["a"]["a"]. 

use == > < >= <= to indicate same, ancestor, child, ancestor or same, child or same.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2010-12-04 01:57
Sender: Guten 

my version of <=> method.

Attached Files:

Name Description Download
a.rb Download
a.rb my version of <=> method. Version 1.1 Download

Changes:

Field Old Value Date By
File Added5045: a.rb2010-12-04 02:05gutenlinux
File Added5044: a.rb2010-12-04 01:58gutenlinux