From leavens@larch.cs.iastate.edu Wed Sep 27 09:59:05 2006 Date: Wed, 27 Sep 2006 09:59:04 -0500 (CDT) From: Gary T. Leavens To: Kent Vander Velden Subject: Re: HW4 typos Hi Kent, On Wed, 27 Sep 2006, Kent Vander Velden wrote: > These 'bugs' are probably really obvious but... > > In 4b the function name is the same as in 4a - perhaps it was meant to be > Borrowed. Of course that does not make much difference. > > In 6b test cases shouldn't there be a couple extra spaces in the third and > fourth test cases? [1#22#3] => [1#2 2#3] Yes, that's right. Thanks for letting me know. I'll fix these in the homework files. Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 ------------------------ From leavens@larch.cs.iastate.edu Sun Oct 1 13:08:56 2006 Date: Sun, 1 Oct 2006 13:08:56 -0500 (CDT) From: Gary T. Leavens To: Chris Cornelison Subject: Re: cs541 - HW4, concatenating strings Hi Chris, On Sat, 30 Sep 2006, Chris Cornelison wrote: > I can't seem to figure out how to concatenate strings together. > The documentation seems to indicate I can use # to create a virtual string > from several strings. > > S1#S2#" "#3.4 > > etc. > > So here's my basic concatenation function > > fun {Concat S1 S2} > S1#S2 > end > {StartTesting "CommaSeparate"} {Test {Concat "Hello" "World"} '=' > "HelloWorld"} > > results in > > testFailed(actual:[72 101 108 108 111]#[87 111 114 108 100] connective:'=' > debug:d(info:unit stack:[entry(,,,) entry(,,,) entry(,,,) entry(,,,)]) > expected:[72 101 108 108 111 87 111 114 108 100]) > > which seems to indicate that # is not concatenating S1 and S2 > > Is there some trick this? You can use Append to concatenate strings, which are lists of characters. The Concat function that you wrote makes a pair, which, as a virtual string, represents the concatenation of the given strings. However, the pair is not == to the append of the given strings, as you can see. Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 ------------------------ From leavens@larch.cs.iastate.edu Mon Oct 2 10:40:38 2006 Date: Mon, 2 Oct 2006 10:40:38 -0500 (CDT) From: Gary T. Leavens To: "Vander Velden, Kent" Subject: Re: CS541 HW4 Hi Kent, On Mon, 2 Oct 2006, Vander Velden, Kent wrote: > Regarding testing HW4 - I got your zip file and have managed to test the > first problem by copying the text from DeleteAllTest.oz into my file. > Is this what you intended or is there a way to simply call the > associated test files without copying the text? You can do that, but it's also possible just to put the line \insert 'DeleteAllTest.oz' into your file (at the bottom) which (in the OPI) will make it run the tests. Gary T. Leavens Department of Computer Science, Iowa State University 229 Atanasoff Hall, Ames, Iowa 50011-1041 USA http://www.cs.iastate.edu/~leavens phone: +1-515-294-1580 ----------------------------------