binary operators

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

binary operators

Yan Falken
Hi,

how about binary operators in bsh - ive got exception when I tried to
use them. Am I doing something badly?

thx

Y


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: binary operators

Paul Franz
Can you give us an example?

Paul Franz

Yan Falken wrote:
> Hi,
>
> how about binary operators in bsh - ive got exception when I tried to
> use them. Am I doing something badly?
>
> thx
>
> Y
>


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

Re: binary operators

patniemeyer
In reply to this post by Yan Falken

> bsh % boolean yes = true;
> bsh % boolean no = false;
> bsh % if ( yes | no ) { };
>
> bsh.InterpreterError: unimplemented binary operator
>         at bsh.Primitive.booleanBinaryOperation(Primitive.java:287)
>         at bsh.Primitive.binaryOperationImpl(Primitive.java:252)
>         at bsh.Primitive.binaryOperation(Primitive.java:230)
>         at bsh.BSHBinaryExpression.eval(BSHBinaryExpression.java:139)
>         at bsh.BSHIfStatement.evaluateCondition(BSHIfStatement.java:63)
>         at bsh.BSHIfStatement.eval(BSHIfStatement.java:46)
>         at bsh.Interpreter.run(Interpreter.java:465)
>         at java.lang.Thread.run(Thread.java:595)

The binary operators should work for logical conditions, but aren't
implemented (that should be on the bugs list).

You can of course do:

  // logial
  if ( yes || no ) { ... };

and

  // binary
  value = 1 | 2 ;

etc...


Pat




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
<a href="http://ads.osdn.com/?ad_idv37&alloc_id865&op=click">http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users
Reply | Threaded
Open this post in threaded view
|

RE: j5 syntax

Daniel Leuck
In reply to this post by Yan Falken
Hello Yan,

No.  The enhanced for loop and autoboxing/unboxing are implemented, but not
generics, enums, varargs, static import, annotations, or the new floating
point literals.

Dan

> -----Original Message-----
> From: [hidden email] [mailto:beanshell-users-
> [hidden email]] On Behalf Of Yan Falken
> Sent: Tuesday, December 20, 2005 6:41 AM
> To: [hidden email]
> Subject: [Beanshell-users] j5 syntax
>
> Hi again, one more question:
>
> is j5 syntax fully implemented in bsh? or what is missing?
> please just tell me if its documented somewhere - I didnt check the docs
> much yet - but in those I saw there were no information about it.
>
> thanks
> Y
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
> _______________________________________________
> Beanshell-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/beanshell-users



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Beanshell-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/beanshell-users