'Path' implementation

Pavel Holejsovsky pavel.holejsovsky at upek.com
Fri Sep 10 06:47:18 PDT 2004


Cool! Thanks for your change of from:as: to as:&root:, I felt that my 
protocol was not right, but simply could not invent the right one :-)

Attached is patch which adjusts testsuite for this change, and also a 
minor bugfix - this one already caught by tests.  I'm glad that I wrote 
one, it starts to pay back!

BTW: is there any reason why you don't commit my 3-liner to 
tests/init.slate?  Is there something wrong with it or was it simply 
overlooked?

Hope that you aren't already tired by committing my incremental 
'improvements' :-)

Pavel

Brian T. Rice wrote:
> I just returned home from work. They're applied now. Thanks!
> 
> Pavel Holejsovsky wrote:
> 
>> Hi Brian,
>>
>>> Thanks for taking the time to work on these. All of the changes (and 
>>> tests!) look good, and I'll apply them now.
>>
>>
>> Thanks for applying it.  Today I was torturing it a bit more and came 
>> with following 'fug bixes' + some indentation and comment typo fixes. 
>> Can you apply this too, please?
>>
>> Pavel
-------------- next part --------------
Index: src/lib/path.slate
===================================================================
RCS file: /var/lib/cvs/slate/slate/src/lib/path.slate,v
retrieving revision 1.4
diff -u -r1.4 path.slate
--- src/lib/path.slate	10 Sep 2004 01:23:03 -0000	1.4
+++ src/lib/path.slate	10 Sep 2004 13:37:19 -0000
@@ -179,7 +179,7 @@
        ifNil: [this slotNotFoundNamed: each].
      this: target
     ].
-  names contents as: path
+  names contents as: path &root: path root
 ].
 
 path@(RootedPath traits) printOn: s

Index: tests/path.slate
===================================================================
RCS file: /var/lib/cvs/slate/slate/tests/path.slate,v
retrieving revision 1.2
diff -u -r1.2 path.slate
--- tests/path.slate	10 Sep 2004 01:23:03 -0000	1.2
+++ tests/path.slate	10 Sep 2004 13:38:43 -0000
@@ -118,14 +118,14 @@
     description: 'RootedPath unrooted is broken.'.
   t assert: (RootedPath from: testLobby to: #a) isNil
     description: 'RootedPath from:to: is broken.'.
-  t assert: (RootedPath from: testLobby as: {#collections}) = 
-            (RootedPath from: testLobby as: {#collections})
+  t assert: ({#collections} as: RootedPath &root: testLobby) = 
+            ({#collections} as: RootedPath &root: testLobby)
     description: 'RootedPath comparison is broken.'.
-  t assert: (RootedPath from: testLobby as: {#collections}) ~=
-            (RootedPath from: lobby as: {#collections})
+  t assert: ({#collections} as: RootedPath &root: testLobby) ~=
+            ({#collections} as: RootedPath &root: lobby)
     description: 'RootedPath comparison is broken (root not considered).'.
-  t assert: (RootedPath from: testLobby as: {#collections}) ~=
-            (RootedPath from: testLobby as: {#prototypes})
+  t assert: ({#collections} as: RootedPath &root: testLobby) ~=
+            ({#prototypes} as: RootedPath &root: testLobby)
     description: 'RootedPath comparison is broken (path not considered).'
 ].
 
@@ -161,7 +161,7 @@
     { testLobby. {#VM. #ByteCode}. {#VM. #ByteCode} }
   } do:
     [| :case p |
-      p: (RootedPath from: case first as: case second) expanded.
+      p: (case second as: RootedPath &root: case first) expanded.
       t assert: (p names = case third) /\ [p root = case first]
 	description: 'RootedPath expanded failed; from "' ; case second print ;
 	             '" expanded to "' ; p names print ; '" but expected "' ;

Index: tests/init.slate
===================================================================
RCS file: /var/lib/cvs/slate/slate/tests/init.slate,v
retrieving revision 1.2
diff -u -r1.2 init.slate
--- tests/init.slate	3 Aug 2004 01:57:19 -0000	1.2
+++ tests/init.slate	10 Sep 2004 13:39:05 -0000
@@ -1,10 +1,13 @@
 load: 'src/lib/test.slate'.
 load: 'src/lib/tokenizer.slate'.
 load: 'src/lib/matrix.slate'.
+load: 'src/lib/path.slate'.
 
 load: 'tests/regression/wordcount.slate'.
+load: 'tests/regression/20040909.slate'.
 load: 'tests/dictionary.slate'.
 load: 'tests/numeric.slate'.
 load: 'tests/matrix.slate'.
 load: 'tests/range.slate'.
+load: 'tests/path.slate'.
 load: 'tests/test.slate'.


More information about the Slate mailing list