Hi Michael,

Yes, this is the expected behaviour, as CLIPS does the same thing:

         CLIPS (V6.0 05/12/93)
CLIPS> (explode$ "001 002 333 004 BOGUS")
(1 2 333 4 BOGUS)

explode$ works by tokenizing the string using the regular tokenizer
used for everything else, and this tokenizer allow leading zeros on
numbers. It understands 001 and 1 as both being the number one.

You could write a trivial Userfunction around
java.util.StringTokenizer which just broke a String into substrings at
spaces, then use that instead of explode$.

I think Michael Lucero wrote:
> 
> I'm not sure if this is an error or intended behavior:
> 
>  (assert (aa "001 002 333 004 BOGUS"))
> 
> 
> (defrule aa
>     (aa ?x)
> =>
>     (printout t "EXPLODED X: " (explode$ ?x) crlf)
> )
> 
> 
> (run) results in the following printout:
> 
> EXPLODED X: (1 2 333 4 BOGUS)
> 
> Notice the leading zeroes of tokens are dropped.  Therefore I cannot
> reason on what I thought was the length of each token.
> 
> Is this expected?  If so, why?
> 
> Thanks,
> ML


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9214                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to