Re: Strings and the like.
- Posted by "Boehme, Gabriel" <gboehme at POSTOFFICE.MUSICLAND.COM> Dec 08, 1999
- 509 views
Lucius L. Hilley III wrote: > The error in using the below code is that it doesn't check to see if there >is a sequence inside s. And if there is. It fails to check it properly as >well. > >Run this example: > >type whole_set(sequence s) > return find(0, s = floor(s)) >end type > >? whole_set({1, 2, 3}) >? whole_set({1, 2, {3}}) >? whole_set({1, 2, {3.14}}) Oops! Er... <SHEEPISH_MODE=ON> >of course you could try this. > >type whole_set(sequence s) > return (compare(repeat(1, length(s)), s = floor(s)) = 1) >end type Okay, so then my all_true() function should be revised as follows: function all_true(sequence s) return equal(s, repeat(1, length(s))) end function Thanks for the correction, Lucius!Hep yadda, Gabriel Boehme ---------- There is no mistake save one: the failure to learn from a mistake. Robert Fripp ---------- </SHEEPISH_MODE> (Well, I don't want to leave it on for *too* long...)