Return-Path: X-Original-To: apmail-commons-dev-archive@www.apache.org Delivered-To: apmail-commons-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B76D29FC5 for ; Tue, 27 Mar 2012 12:18:33 +0000 (UTC) Received: (qmail 77041 invoked by uid 500); 27 Mar 2012 12:18:33 -0000 Delivered-To: apmail-commons-dev-archive@commons.apache.org Received: (qmail 76939 invoked by uid 500); 27 Mar 2012 12:18:33 -0000 Mailing-List: contact dev-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Developers List" Delivered-To: mailing list dev@commons.apache.org Received: (qmail 76930 invoked by uid 99); 27 Mar 2012 12:18:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2012 12:18:33 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of garydgregory@gmail.com designates 209.85.160.43 as permitted sender) Received: from [209.85.160.43] (HELO mail-pb0-f43.google.com) (209.85.160.43) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 27 Mar 2012 12:18:26 +0000 Received: by pbcwz12 with SMTP id wz12so184780pbc.30 for ; Tue, 27 Mar 2012 05:18:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=s8X0DazRgcfLOu7E+nzpwJEPkJYPeob2CfaoM+AGFeg=; b=sUkMKmyzOXPwkM5wzTI6r6WnuKqKbQHe3ucbAzl8w3Q9RypARmC0GlUCc0gYlEFh1Y FNFr5acCsJ8Ridj8hXVjMxLQ0H96vGpr9OftsO1qOR9fQTsrXRt0vnACyPYmjC6ivXdE s6WxN76ytl/C0g8i05F5/9cZ3ioYQKxGhtWf4Qim9eS6OThVQdcEiox+lukviM54McpL VibLljNu83SOVoCeLX+9p2WSk7oJcoWeHgnBxTvW3CG5hUG0OD7VdwTcA555y7CQWiWk D58PiiX8xOadU2AlNCHW8PeinnMNvdVysCrmvgTd3t1bvHthHewZ6ugPDBQc2MsKzjNK Uk+Q== MIME-Version: 1.0 Received: by 10.68.136.10 with SMTP id pw10mr62546458pbb.134.1332850685172; Tue, 27 Mar 2012 05:18:05 -0700 (PDT) Received: by 10.68.55.161 with HTTP; Tue, 27 Mar 2012 05:18:04 -0700 (PDT) In-Reply-To: References: <20120327075853.225200@gmx.net> Date: Tue, 27 Mar 2012 08:18:04 -0400 Message-ID: Subject: Re: [math] Improvement: Interpreter for mathematical expressions From: Gary Gregory To: Commons Developers List Content-Type: multipart/alternative; boundary=047d7b15ae33a0de1c04bc387bd3 --047d7b15ae33a0de1c04bc387bd3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Mar 27, 2012 at 5:50 AM, sebb wrote: > 2012/3/27 "Detlef G=C3=BCnther" : > > Hello, > > > > it would be nice to have an interpreter for mathematical expressions so > that functions may be defined at runtime. > > > > Example for f(x): > > > > ExpInter ei =3D new ExpInter(); > > ei.setFunction("ln(3*sin(2*x)+3)"); > > // Plot the function: > > for (double x=3D0.0;x<3.0;x+=3D0.1) { > > y =3D ei(x); > > // ... do something useful with x,y > > } > > > > Seems completely out of scope for Math to me. > > Besides, there are already scripting languages such as Commons JEXL > and BeanShell. > JavaScript is also baked in Java 6 and you can use any Java scripting enabled engine. Gary > These can call just about any method you want, and BeanShell allows > one to define functions. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org > For additional commands, e-mail: dev-help@commons.apache.org > > --=20 E-Mail: garydgregory@gmail.com | ggregory@apache.org JUnit in Action, 2nd Ed: http://bit.ly/ECvg0 Spring Batch in Action: http://bit.ly/bqpbCK Blog: http://garygregory.wordpress.com Home: http://garygregory.com/ Tweet! http://twitter.com/GaryGregory --047d7b15ae33a0de1c04bc387bd3--