Browse Source

use property for length.

Nicolas Cannasse 19 years ago
parent
commit
01426f0593
1 changed files with 2 additions and 1 deletions
  1. 2 1
      std/List.hx

+ 2 - 1
std/List.hx

@@ -56,6 +56,7 @@ class ListIter<T> implements Iterator<T> {
 class List<T> {
 
 	private var h : Cell<T>;
+	public property length(getLength,null) : Int;
 
 	public function new() {
 		h = empty;
@@ -110,7 +111,7 @@ class List<T> {
 		return found;
 	}
 
-	public function length() {
+	public function getLength() {
 		var c = 0;
 		var h = this.h;
 		while( true ) {