Hi Tomas,

> > I cannot see, though, whether you also handle a mapping of Lisp lists
> > from/to Java arrays, which doubles the code in the case of ErsatzLisp.
> I think there are two functions: 'jv2l' and 'jvector'.

I see. I cannot find out how it works, however. I tried:

   : (setq S (jnew (jclass 'java.lang.String) "abcde"))
   -> "abcde"

   :  (S 'getBytes)
   -> [...@1027b4d]

How do I retrieve the actual bytes then? I tried 'jv2l' and 'jvector'
but get an error "No Cons.obj".

For example, in ErsatzLisp I do this as

   : (setq S (java "java.lang.String" T "abcde"))
   -> $String

   : (java (java S "getBytes"))
   -> (97 98 99 100 101)

You also do the opposite (construct a string out of single bytes)

   : (java "java.lang.String" T (mapcar byte: (100 101 102)))
   -> $String

   : (java @)
   -> "def"

- Alex
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to