[Bese-devel] Re: Another parenscript issue

Pierre THIERRY nowhere.man at levallois.eu.org
Mon Nov 27 14:41:34 UTC 2006


Scribit Marco Baringer dies 27/11/2006 hora 15:19:
> does this work:
> 
> CL-USER> (js:js* '(- 4))
> "-4;"
> CL-USER> (js:js* '(+ 4))
> "+4;"
> CL-USER> (js:js* '(/ 4))
> "/4;"
> CL-USER> (js:js* '(* 4))
> "*4;"
> CL-USER> 

Well, maybe the notion of neutral operand (not sure if it's the correct
ENglish term) would fit there: 0 for + and -, 1 for * and /:

(js:js* '(- 4)) ==> "-4;"  ; 0-4
(js:js* '(+ 4)) ==> "4;"   ; 0+4
(js:js* '(/ 4)) ==> "1/4;" ; 1/4
(js:js* '(* 4)) ==> "4;"   ; 1*4

> or do we want to be smart and special case just - ?

I'll say special case either just '- or both '- and '/. If I'm not
mistaken, in the former, the / wil just have no sense for javascript.

Mathematically,
Pierre
-- 
nowhere.man at levallois.eu.org
OpenPGP 0xD9D50D8A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://mailman.common-lisp.net/pipermail/bese-devel/attachments/20061127/e18d471b/attachment.sig>


More information about the bese-devel mailing list