Well, Jess has its own LISP-like type system, following the one from CLIPS. Jess has one type that Java doesn't (symbols) and doesn't make many of the distinctions that Java does. For the most part this doesn't matter; in a very high-level language, you're generally not worrying about data types. Having the full range of Java data types in a pattern-matching language would be a nightmare -- do two values not match because they're not equal, or because one is an int and one is a short?
When Jess calls out to Java functions, though, it has to map the Java types onto its own types and vice-versa, and that mapping has to be predictable. In my code snippet below ( i.e., (call "foo" charAt 0) ) that -is- the java.lang.String.charAt() function, and it -does- return a char. The question is, given Jess's available types (INTEGER, LONG, FLOAT, ATOM, STRING, EXTERNAL_ADDRESS) how should Jess represent that char? What I'm suggesting is that INTEGER is a better match than STRING, and I'm wondering if anybody has any code that would break if I made this change. I think Bryan Talbot wrote: > > Why have it return an int instead of a char like the > java.lang.String.charAt() method does? Also, with a method name like > "charAt", I would intuitively expect a char type to be returned. > > >From: [EMAIL PROTECTED] > > > > > >Currently, Jess maps Java char values onto Jess Strings; i.e., > >the result of (call "foo" charAt 0) is "f". I'm starting to > >think that this is the wrong mapping -- a Jess integer would > >make more sense (i.e., 102.) Does anybody have an opinion, one > >way or the other? > > --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 Org. 8920, MS 9012 [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 (use your own address!) List problems? Notify [EMAIL PROTECTED] --------------------------------------------------------------------