From git at ginac.de Fri Jul 10 15:06:45 2009 From: git at ginac.de (Jens Vollinga) Date: Fri, 10 Jul 2009 15:06:45 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-192-g55d4f0e Message-ID: <20090710130646.34F895B4058@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via 55d4f0ebf2f99840c24c1e2ba823fbb7722d41bd (commit) from 4847adb5b4143c9ad9aff29d212a1656e59f02c1 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 55d4f0ebf2f99840c24c1e2ba823fbb7722d41bd Author: Jens Vollinga Date: Fri Jul 10 09:54:09 2009 +0200 Fixed manual to correctly explain return_type_tinfo(). (cherry picked from commit feed241b95f7dbd6294795b4afc2bcae41880c31) ----------------------------------------------------------------------- Summary of changes: doc/tutorial/ginac.texi | 63 +++++++++++++++++++++++++++------------------- 1 files changed, 37 insertions(+), 26 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From git at ginac.de Fri Jul 10 15:06:46 2009 From: git at ginac.de (Jens Vollinga) Date: Fri, 10 Jul 2009 15:06:46 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-191-gf38cbcd Message-ID: <20090710130646.92C655B4051@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via f38cbcd651246fb5c1294705d29399f3cbfddaf5 (commit) via feed241b95f7dbd6294795b4afc2bcae41880c31 (commit) from 71803f13294618ddd3f19fd0d9871cc44023c155 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f38cbcd651246fb5c1294705d29399f3cbfddaf5 Author: Jens Vollinga Date: Fri Jul 10 15:01:04 2009 +0200 Changed the parser such that it understands all defined functions including the user defined ones. To this end a method has been added to class function to allow the modified get_default_reader() function to build up a complete prototype table. The autogen tool is no longer required. commit feed241b95f7dbd6294795b4afc2bcae41880c31 Author: Jens Vollinga Date: Fri Jul 10 09:54:09 2009 +0200 Fixed manual to correctly explain return_type_tinfo(). ----------------------------------------------------------------------- Summary of changes: INSTALL | 3 +- configure.ac | 4 -- doc/tutorial/ginac.texi | 63 ++++++++++++++++----------- ginac/Makefile.am | 18 +------- ginac/function.pl | 1 + ginac/parser/builtin_fcns.def | 90 --------------------------------------- ginac/parser/default_reader.tpl | 50 --------------------- ginac/parser/parse_context.cpp | 20 +++++++++ ginac/parser/parse_context.h | 21 +++------ ginac/parser/parser.cpp | 3 +- 10 files changed, 69 insertions(+), 204 deletions(-) delete mode 100644 ginac/parser/builtin_fcns.def delete mode 100644 ginac/parser/default_reader.tpl hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From git at ginac.de Sat Jul 11 02:58:04 2009 From: git at ginac.de (Jens Vollinga) Date: Sat, 11 Jul 2009 02:58:04 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations tag, release_1-5-2, created. release_1-4-0-193-g6130b91 Message-ID: <20090711005804.EEA485B4054@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The tag, release_1-5-2 has been created at 6130b911feb5c516b00081b867fb0aef487f212a (commit) - Log ----------------------------------------------------------------- commit 6130b911feb5c516b00081b867fb0aef487f212a Author: Jens Vollinga Date: Fri Jul 10 15:21:09 2009 +0200 Preparing for release 1.5.2. ----------------------------------------------------------------------- hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From git at ginac.de Sat Jul 11 02:59:35 2009 From: git at ginac.de (Jens Vollinga) Date: Sat, 11 Jul 2009 02:59:35 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-193-g6130b91 Message-ID: <20090711005935.485F15B4054@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via 6130b911feb5c516b00081b867fb0aef487f212a (commit) from 55d4f0ebf2f99840c24c1e2ba823fbb7722d41bd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6130b911feb5c516b00081b867fb0aef487f212a Author: Jens Vollinga Date: Fri Jul 10 15:21:09 2009 +0200 Preparing for release 1.5.2. ----------------------------------------------------------------------- Summary of changes: NEWS | 5 +++++ configure.ac | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From jensv at nikhef.nl Sat Jul 11 03:07:03 2009 From: jensv at nikhef.nl (Jens Vollinga) Date: Sat, 11 Jul 2009 03:07:03 +0200 Subject: [GiNaC-devel] [GiNaC-list] Release GiNaC 1.5.2 Message-ID: <4A57E5B7.1030304@nikhef.nl> Hi everybody, GiNaC 1.5.2 is out and available. The changes are: * Fixed documentation of return_type_info(). * Fixed cstdio include issue. * GiNaC now requires at least version 1.2.2 of cln. As always, this release can be downloaded from http://www.ginac.de/Download.html Best wishes, Jens _______________________________________________ GiNaC-list mailing list GiNaC-list at ginac.de https://www.cebix.net/mailman/listinfo/ginac-list From git at ginac.de Wed Jul 15 08:26:13 2009 From: git at ginac.de (Jens Vollinga) Date: Wed, 15 Jul 2009 08:26:13 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-195-g44f71c7 Message-ID: <20090715062613.C55445B4041@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via 44f71c740cc727dc30436e240b9a27021a6d7fdf (commit) via 5fc9d1ab7fa870e78070bf412a28bfcf497c05b9 (commit) from 6130b911feb5c516b00081b867fb0aef487f212a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 44f71c740cc727dc30436e240b9a27021a6d7fdf Author: Jens Vollinga Date: Wed Jul 15 05:19:07 2009 +0200 Allow underscores in identifiers. (cherry picked from commit 619879b5bd86a99334affe1f05d17616cc2c1898) commit 5fc9d1ab7fa870e78070bf412a28bfcf497c05b9 Author: Jens Vollinga Date: Wed Jul 15 08:26:33 2009 +0200 Allow user defined functions to be parsed. This patch is an ugly hack that does the same as the commit f38cbcd651246fb5c1294705d29399f3cbfddaf5 but without changing the ABI (so it can be used in ginac_1-5). ----------------------------------------------------------------------- Summary of changes: ginac/function.pl | 4 +++- ginac/parser/default_reader.tpl | 21 ++++++++++++++++----- ginac/parser/lexer.cpp | 4 ++-- ginac/parser/parse_context.h | 5 +++++ ginac/parser/parser.cpp | 3 ++- 5 files changed, 28 insertions(+), 9 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From git at ginac.de Wed Jul 15 08:26:13 2009 From: git at ginac.de (Jens Vollinga) Date: Wed, 15 Jul 2009 08:26:13 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, master, updated. release_1-4-0-192-g619879b Message-ID: <20090715062614.191B45B403E@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, master has been updated via 619879b5bd86a99334affe1f05d17616cc2c1898 (commit) from f38cbcd651246fb5c1294705d29399f3cbfddaf5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 619879b5bd86a99334affe1f05d17616cc2c1898 Author: Jens Vollinga Date: Wed Jul 15 05:19:07 2009 +0200 Allow underscores in identifiers. ----------------------------------------------------------------------- Summary of changes: ginac/parser/lexer.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From git at ginac.de Thu Jul 30 20:36:56 2009 From: git at ginac.de (Jens Vollinga) Date: Thu, 30 Jul 2009 20:36:56 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations tag, release_1-5-3, created. release_1-4-0-196-geb19233 Message-ID: <20090730183656.BDD5D5B404D@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The tag, release_1-5-3 has been created at eb192338b3abd1252523a013a4f924ee38b10039 (commit) - Log ----------------------------------------------------------------- commit eb192338b3abd1252523a013a4f924ee38b10039 Author: Jens Vollinga Date: Thu Jul 30 19:04:32 2009 +0200 Preparing for release 1.5.3. ----------------------------------------------------------------------- hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From git at ginac.de Thu Jul 30 20:37:32 2009 From: git at ginac.de (Jens Vollinga) Date: Thu, 30 Jul 2009 20:37:32 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-196-geb19233 Message-ID: <20090730183732.9299F5B4055@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via eb192338b3abd1252523a013a4f924ee38b10039 (commit) from 44f71c740cc727dc30436e240b9a27021a6d7fdf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit eb192338b3abd1252523a013a4f924ee38b10039 Author: Jens Vollinga Date: Thu Jul 30 19:04:32 2009 +0200 Preparing for release 1.5.3. ----------------------------------------------------------------------- Summary of changes: NEWS | 4 ++++ configure.ac | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From jensv at nikhef.nl Thu Jul 30 20:47:55 2009 From: jensv at nikhef.nl (Jens Vollinga) Date: Thu, 30 Jul 2009 20:47:55 +0200 Subject: [GiNaC-devel] Release GiNaC 1.5.3 Message-ID: <4A71EADB.7020004@nikhef.nl> Hi everybody, GiNaC 1.5.3 is out and available. The changes are: * The parser now understands user-defined functions by default. The parsed identifier names can now contain underscores. As always, this release can be downloaded from http://www.ginac.de/Download.html Best wishes, Jens From kreckel at ginac.de Fri Jul 31 09:00:10 2009 From: kreckel at ginac.de (Richard B. Kreckel) Date: Fri, 31 Jul 2009 09:00:10 +0200 Subject: [GiNaC-devel] Release GiNaC 1.5.3 In-Reply-To: <4A71EADB.7020004@nikhef.nl> References: <4A71EADB.7020004@nikhef.nl> Message-ID: <4A72967A.4030900@ginac.de> Dear Jens, Jens Vollinga wrote: > As always, this release can be downloaded from > http://www.ginac.de/Download.html While building Debian packages, g++ 4.3.3 complained "parser/parser.cpp:69: error: cast from 'GiNaC::ex (*)(const GiNaC::exvector&)' to 'unsigned int' loses precision". (Besides, that's a weird error message!) Looking closer, I see that the tarball is not what's tagged in git. Since it doesn't build anyway, I suggest to cheat a bit and remove the tarballs and replace them with what's in git. Cheers -richy. -- Richard B. Kreckel From jensv at nikhef.nl Fri Jul 31 09:44:10 2009 From: jensv at nikhef.nl (Jens Vollinga) Date: Fri, 31 Jul 2009 09:44:10 +0200 Subject: [GiNaC-devel] Release GiNaC 1.5.3 In-Reply-To: <4A72967A.4030900@ginac.de> References: <4A71EADB.7020004@nikhef.nl> <4A72967A.4030900@ginac.de> Message-ID: <4A72A0CA.3040207@nikhef.nl> Hi Richy, Richard B. Kreckel schrieb: > While building Debian packages, g++ 4.3.3 complained > "parser/parser.cpp:69: error: cast from 'GiNaC::ex (*)(const > GiNaC::exvector&)' to 'unsigned int' loses precision". (Besides, that's > a weird error message!) I cannot reproduce these problems, but I am using gcc 4.4. Later the day I can try it with gcc 4.3.3. > Looking closer, I see that the tarball is not what's tagged in git. Eh? To me the tar package looks exactly like the release_1-5-3 tagged blob. The NEWS file, the changes in lexer.cpp, etc. are all in there. How did you find differences and what are they? > Since it doesn't build anyway, I suggest to cheat a bit and remove the > tarballs and replace them with what's in git. I am prepared to cheat ;-) but let's clarify first what is going on. Regards, Jens From varg at metalica.kh.ua Fri Jul 31 09:36:12 2009 From: varg at metalica.kh.ua (Alexei Sheplyakov) Date: Fri, 31 Jul 2009 10:36:12 +0300 Subject: [GiNaC-devel] Parser breakage^W changes In-Reply-To: <20090710130646.92C655B4051@cebix.net> References: <20090710130646.92C655B4051@cebix.net> Message-ID: <20090731073612.GA18752@metalica.kh.ua> Hello, On Fri, Jul 10, 2009 at 03:06:46PM +0200, Jens Vollinga wrote: > commit f38cbcd651246fb5c1294705d29399f3cbfddaf5 > Author: Jens Vollinga > Date: Fri Jul 10 15:01:04 2009 +0200 > > Changed the parser such that it understands all defined functions > including the user defined ones. And it does not understand pow, sqrt, power, and user defined classes any more :( > diff --git a/ginac/parser/parse_context.h b/ginac/parser/parse_context.h > index 15dfcd6..c7360dd 100644 > --- a/ginac/parser/parse_context.h > +++ b/ginac/parser/parse_context.h > @@ -72,25 +72,18 @@ typedef ex (*reader_func)(const exvector& args); > * foo(x+y, z^2, t)), it looks up such a table to find out which > * function (or class) corresponds to the given name and has the given > * number of the arguments. > - * > - * N.B. > - * > - * 1. The function don't have to return a (GiNaC) function or class, it > - * can return any expression. > - * 2. Overloaded functions/ctors are paritally supported, i.e. there might > - * be several functions with the same name, but they should take different > - * number of arguments. > - * 3. User can extend the parser via custom prototype tables. It's possible > - * to read user defined classes, create abbreviations, etc. > */ > -typedef std::map prototype_table; > +typedef std::map prototype_table; This breaks existing code (both GiNaC and `user code') and is not welcome. It's impossible (or at least difficult) to extend the parser now (i.e. to read `user defined' classes). Please revert. Also I dislike the idea. Being able to define function in such a way that parser knows nothing about it is a good thing. It is useful to make sure that input does NOT contain certain (auxiliary) functions. Previously this was very easy: don't tell the parser about those functions, and that's it. Now parser understands every auxiliary function (which is not supposed to appear in input or output expressions) so extra checks are necessary. Although it's possible to make a custom parser table (start from the default one and erase unwanted functions from it) this requires more (boilerplate) code. Best regards, Alexei From varg at metalica.kh.ua Fri Jul 31 10:37:56 2009 From: varg at metalica.kh.ua (Alexei Sheplyakov) Date: Fri, 31 Jul 2009 11:37:56 +0300 Subject: [GiNaC-devel] Yet another parser related breakage (Was: Release GiNaC 1.5.3) In-Reply-To: <4A72967A.4030900@ginac.de> References: <4A71EADB.7020004@nikhef.nl> <4A72967A.4030900@ginac.de> Message-ID: <20090731083756.GA20740@metalica.kh.ua> Dear all, On Fri, Jul 31, 2009 at 09:00:10AM +0200, Richard B. Kreckel wrote: > While building Debian packages, g++ 4.3.3 complained > "parser/parser.cpp:69: error: cast from 'GiNaC::ex (*)(const > GiNaC::exvector&)' to 'unsigned int' loses precision". (Besides, that's > a weird error message!) I think the error message is absolutely correct. The thing is that commit 5fc9d1ab ('Allow user defined functions to be parsed') contains (at least) two (unrelated) bugs. First of all, the parser can not read pow, sqrt, and user-defined classes any more. Secondly, the code is not going to work on 64-bit architectures due to the cast from integer into a pointer (to a function): ginac/parser/default_reader.tpl: for ( unsigned ser=0; ; ++ser ) { GiNaC::function f(ser); std::string name = f.get_name(); for ( std::size_t nargs=0; ; ++nargs ) { try { function::find_function(name, nargs); prototype proto = std::pair(name, nargs); std::pair ins = reader.insert(std::pair(proto, (reader_func)ser)); // BAD BAD BAD: converting int into void* I think the above mentioned commit is wrong and should be reverted. Best regards, Alexei From kreckel at ginac.de Fri Jul 31 11:37:53 2009 From: kreckel at ginac.de (Richard B. Kreckel) Date: Fri, 31 Jul 2009 11:37:53 +0200 Subject: [GiNaC-devel] Release GiNaC 1.5.3 In-Reply-To: <4A72A0CA.3040207@nikhef.nl> References: <4A71EADB.7020004@nikhef.nl> <4A72967A.4030900@ginac.de> <4A72A0CA.3040207@nikhef.nl> Message-ID: <4A72BB71.3070904@ginac.de> Hi, all! Jens Vollinga wrote: > Richard B. Kreckel schrieb: >> While building Debian packages, g++ 4.3.3 complained >> "parser/parser.cpp:69: error: cast from 'GiNaC::ex (*)(const >> GiNaC::exvector&)' to 'unsigned int' loses precision". (Besides, >> that's a weird error message!) > > I cannot reproduce these problems, but I am using gcc 4.4. Later the day > I can try it with gcc 4.3.3. GCC 4.4.1 produces the same error over here. I suppose you aren't seeing it because your's is a 32-bit system? >> Looking closer, I see that the tarball is not what's tagged in git. > > Eh? To me the tar package looks exactly like the release_1-5-3 tagged > blob. The NEWS file, the changes in lexer.cpp, etc. are all in there. > How did you find differences and what are they? Ooops, sorry. What I was seeing were some diffs in auto-generated files. -richy. -- Richard B. Kreckel From jensv at nikhef.nl Fri Jul 31 11:40:29 2009 From: jensv at nikhef.nl (Jens Vollinga) Date: Fri, 31 Jul 2009 11:40:29 +0200 Subject: [GiNaC-devel] Release GiNaC 1.5.3 In-Reply-To: <4A72BB71.3070904@ginac.de> References: <4A71EADB.7020004@nikhef.nl> <4A72967A.4030900@ginac.de> <4A72A0CA.3040207@nikhef.nl> <4A72BB71.3070904@ginac.de> Message-ID: <4A72BC0D.8040007@nikhef.nl> Hi Richy, Richard B. Kreckel schrieb: > GCC 4.4.1 produces the same error over here. I suppose you aren't seeing > it because your's is a 32-bit system? yes, it is related to 64bit systems. I fixed it in my repository and I will soon push it into public. I am going to do a 1.5.4 release soon. That'll be the cleanest way to progress. And yes, I should finally buy a new computer ... ;-) Regards, Jens From git at ginac.de Fri Jul 31 12:50:26 2009 From: git at ginac.de (Jens Vollinga) Date: Fri, 31 Jul 2009 12:50:26 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-198-g8bf0597 Message-ID: <20090731105027.2582E5B4045@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via 8bf0597dde55e4c94a2ff39f1d8130902e3d7a9b (commit) via eaf81b3115697a8e883848ace0ceb919cf443b2c (commit) from eb192338b3abd1252523a013a4f924ee38b10039 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8bf0597dde55e4c94a2ff39f1d8130902e3d7a9b Author: Jens Vollinga Date: Fri Jul 31 12:48:58 2009 +0200 Fixed the parser such that it can read in user defined classes again. Fixed default reader to parse also pow, sqrt and power. commit eaf81b3115697a8e883848ace0ceb919cf443b2c Author: Jens Vollinga Date: Fri Jul 31 11:14:01 2009 +0200 Fixed cast that caused compile error on 64bit machines. ----------------------------------------------------------------------- Summary of changes: ginac/function.pl | 3 ++ ginac/parser/builtin_fcns.def | 76 --------------------------------------- ginac/parser/default_reader.tpl | 5 +++ ginac/parser/parser.cpp | 12 +++++- 4 files changed, 18 insertions(+), 78 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From jensv at nikhef.nl Fri Jul 31 13:07:37 2009 From: jensv at nikhef.nl (Jens Vollinga) Date: Fri, 31 Jul 2009 13:07:37 +0200 Subject: [GiNaC-devel] Parser breakage changes In-Reply-To: <20090731073612.GA18752@metalica.kh.ua> References: <20090710130646.92C655B4051@cebix.net> <20090731073612.GA18752@metalica.kh.ua> Message-ID: <4A72D079.9040609@nikhef.nl> Hi Alexei, Alexei Sheplyakov schrieb: > And it does not understand pow, sqrt, power, and user defined classes > any more :( fixed now. > This breaks existing code (both GiNaC and `user code') and is not welcome. It is _very_ welcome by some people that had their existing code broken by your new parser. I got quite some nasty complains about it. Now, I see the problem that it breaks _your_ existing code, but when thinking about whether I should hurt the other people's code or introduce a different parser behavior I opted for the first option, because the parser as it was violated the basic assumption (not only that of the people that complained but also mine!) that the parser, without any tweaking, should just read any expression containing any functions and classes defined at that moment. > It's impossible (or at least difficult) to extend the parser now (i.e. to > read `user defined' classes). Please revert. I extended it accordingly. Now it should work. Feel free to test it, I might have overlooked some issues again. The hack is dirty but only intended for 1.5.x. For future branches we have to do something better. This still needs to be done sooner or later. > Also I dislike the idea. Being able to define function in such a way that > parser knows nothing about it is a good thing. It is useful to make sure > that input does NOT contain certain (auxiliary) functions. Previously this Useful for what? Your preferences here are very particular, probably because you are not a regular GiNaC user but also a developer. A user shouldn't be forced to define his own reader just to get a simple expression read in (just look at that stupid boilerplate code http://www.ginac.de/pipermail/ginac-list/2009-June/001540.html ) > was very easy: don't tell the parser about those functions, and that's it. > Now parser understands every auxiliary function (which is not supposed to > appear in input or output expressions) so extra checks are necessary. You are still free to define your own reader for that special purpose. > Although it's possible to make a custom parser table (start from the default > one and erase unwanted functions from it) this requires more (boilerplate) > code. Yeah, more boilerplate code, right, but now only people with special needs have to go through this hassle and not the average user anymore. Regards, Jens From jensv at nikhef.nl Fri Jul 31 13:11:44 2009 From: jensv at nikhef.nl (Jens Vollinga) Date: Fri, 31 Jul 2009 13:11:44 +0200 Subject: [GiNaC-devel] Parser breakage changes In-Reply-To: <4A72D079.9040609@nikhef.nl> References: <20090710130646.92C655B4051@cebix.net> <20090731073612.GA18752@metalica.kh.ua> <4A72D079.9040609@nikhef.nl> Message-ID: <4A72D170.3060903@nikhef.nl> Hi, just to flood the list ;-) and prevent some misunderstandings: Jens Vollinga schrieb: > introduce a different parser behavior I opted for the first option, I meant "second option", that is changing the parser behavior. Regards, Jens From varg at metalica.kh.ua Fri Jul 31 13:57:13 2009 From: varg at metalica.kh.ua (Alexei Sheplyakov) Date: Fri, 31 Jul 2009 14:57:13 +0300 Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-198-g8bf0597 In-Reply-To: <20090731105027.2582E5B4045@cebix.net> References: <20090731105027.2582E5B4045@cebix.net> Message-ID: <20090731115713.GA26845@metalica.kh.ua> Dear Jens, On Fri, Jul 31, 2009 at 12:50:26PM +0200, Jens Vollinga wrote: > commit eaf81b3115697a8e883848ace0ceb919cf443b2c > Author: Jens Vollinga > Date: Fri Jul 31 11:14:01 2009 +0200 > > Fixed cast that caused compile error on 64bit machines. diff --git a/ginac/parser/parser.cpp b/ginac/parser/parser.cpp index a46017d..d91b7e8 100644 --- a/ginac/parser/parser.cpp +++ b/ginac/parser/parser.cpp @@ -66,8 +66,16 @@ ex parser::parse_identifier_expr() Parse_error_("no function \"" << name << "\" with " << args.size() << " arguments"); } - ex ret = GiNaC::function(reinterpret_cast(reader->second), args); - return ret; + // dirty hack to distinguish between serial numbers of functions and real + // pointers. + ex ret; + try { + ret = GiNaC::function(reinterpret_cast(reader->second), args); + } + catch ( std::runtime_error ) { + ret = reader->second(args); + } + return ret; } I'm afraid this code is a bit dangerous. Suppose reader->second corresponds to the serial of some (GiNaC::)function (and not a pointer to a C++ function). ret = GiNaC::function(...) calls eval(), and it might throw an exception. We catch the exception and dereference ->second => oops... Best regards, Alexei From git at ginac.de Fri Jul 31 14:42:25 2009 From: git at ginac.de (Jens Vollinga) Date: Fri, 31 Jul 2009 14:42:25 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-199-gf059ebe Message-ID: <20090731124225.2BD135B4045@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via f059ebe117d15292e0d262e6e8e232e835c7e33c (commit) from 8bf0597dde55e4c94a2ff39f1d8130902e3d7a9b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f059ebe117d15292e0d262e6e8e232e835c7e33c Author: Jens Vollinga Date: Fri Jul 31 14:41:08 2009 +0200 Fixed dirty hack in parser to distinguish between serial numbers and pointers. ----------------------------------------------------------------------- Summary of changes: ginac/parser/parser.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From jensv at nikhef.nl Fri Jul 31 14:43:38 2009 From: jensv at nikhef.nl (Jens Vollinga) Date: Fri, 31 Jul 2009 14:43:38 +0200 Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-198-g8bf0597 In-Reply-To: <20090731115713.GA26845@metalica.kh.ua> References: <20090731105027.2582E5B4045@cebix.net> <20090731115713.GA26845@metalica.kh.ua> Message-ID: <4A72E6FA.2060904@nikhef.nl> Hi Alexei, Alexei Sheplyakov schrieb: > I'm afraid this code is a bit dangerous. > > Suppose reader->second corresponds to the serial of some (GiNaC::)function > (and not a pointer to a C++ function). ret = GiNaC::function(...) calls > eval(), and it might throw an exception. We catch the exception and > dereference ->second => oops... you are right. I fixed it now. Thanks! Regards, Jens From varg at metalica.kh.ua Fri Jul 31 15:23:32 2009 From: varg at metalica.kh.ua (Alexei Sheplyakov) Date: Fri, 31 Jul 2009 16:23:32 +0300 Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-198-g8bf0597 In-Reply-To: <4A72E6FA.2060904@nikhef.nl> References: <20090731105027.2582E5B4045@cebix.net> <20090731115713.GA26845@metalica.kh.ua> <4A72E6FA.2060904@nikhef.nl> Message-ID: <20090731132332.GA29991@metalica.kh.ua> On Fri, Jul 31, 2009 at 02:43:38PM +0200, Jens Vollinga wrote: > Alexei Sheplyakov schrieb: >> I'm afraid this code is a bit dangerous. >> >> Suppose reader->second corresponds to the serial of some (GiNaC::)function >> (and not a pointer to a C++ function). ret = GiNaC::function(...) calls >> eval(), and it might throw an exception. We catch the exception and >> dereference ->second => oops... > > you are right. I fixed it now. Thanks! I don't think the new variant is any different. 69 // dirty hack to distinguish between serial numbers of functions and real 70 // pointers. 71 try { 72 GiNaC::function f(reinterpret_cast(reader->second), args); 73 return f; eval() is still called here. The compiler has to call ex::ex(const basic&) ctor in order to convert the value being returned to the correct type (ex). That ctor calls ex::construct_from_basic(const basic&), and it calls eval() (which might throw an exception, and so on). Best regards, Alexei From git at ginac.de Fri Jul 31 15:30:01 2009 From: git at ginac.de (Jens Vollinga) Date: Fri, 31 Jul 2009 15:30:01 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-200-g7a092f6 Message-ID: <20090731133001.A58015B4045@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via 7a092f6f6256bac2e5b7c35222fe7e18ca980401 (commit) from f059ebe117d15292e0d262e6e8e232e835c7e33c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7a092f6f6256bac2e5b7c35222fe7e18ca980401 Author: Jens Vollinga Date: Fri Jul 31 15:29:17 2009 +0200 Fixed the fix in commit f059ebe117d15292e0d262e6e8e232e835c7e33c. ----------------------------------------------------------------------- Summary of changes: ginac/parser/parser.cpp | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From jensv at nikhef.nl Fri Jul 31 15:30:45 2009 From: jensv at nikhef.nl (Jens Vollinga) Date: Fri, 31 Jul 2009 15:30:45 +0200 Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-198-g8bf0597 In-Reply-To: <20090731132332.GA29991@metalica.kh.ua> References: <20090731105027.2582E5B4045@cebix.net> <20090731115713.GA26845@metalica.kh.ua> <4A72E6FA.2060904@nikhef.nl> <20090731132332.GA29991@metalica.kh.ua> Message-ID: <4A72F205.1090908@nikhef.nl> Hi Alexei, Alexei Sheplyakov schrieb: > I don't think the new variant is any different. oops, yes, thanks. What was I thinking?!? Now it should be fixed. Regards, Jens From varg at metalica.kh.ua Fri Jul 31 16:38:27 2009 From: varg at metalica.kh.ua (Alexei Sheplyakov) Date: Fri, 31 Jul 2009 17:38:27 +0300 Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-198-g8bf0597 In-Reply-To: <4A72F205.1090908@nikhef.nl> References: <20090731105027.2582E5B4045@cebix.net> <20090731115713.GA26845@metalica.kh.ua> <4A72E6FA.2060904@nikhef.nl> <20090731132332.GA29991@metalica.kh.ua> <4A72F205.1090908@nikhef.nl> Message-ID: <20090731143827.GA3183@metalica.kh.ua> On Fri, Jul 31, 2009 at 03:30:45PM +0200, Jens Vollinga wrote: > oops, yes, thanks. What was I thinking?!? 71 GiNaC::function* f; 72 try { 73 f = new GiNaC::function(reinterpret_cast(reader->second), args); 74 } 75 catch ( std::runtime_error ) { I think if (f) delete f; should be inserted here, otherwise we might leak memory if ->second is a pointer to a (C++) function. Best regards, Alexei From git at ginac.de Fri Jul 31 17:54:42 2009 From: git at ginac.de (Jens Vollinga) Date: Fri, 31 Jul 2009 17:54:42 +0200 (CEST) Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-201-g5252d38 Message-ID: <20090731155442.49A3F5B4045@cebix.net> This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GiNaC -- a C++ library for symbolic computations". The branch, ginac_1-5 has been updated via 5252d38313c423465b9bc37b0618cb8de96d0d4e (commit) from 7a092f6f6256bac2e5b7c35222fe7e18ca980401 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5252d38313c423465b9bc37b0618cb8de96d0d4e Author: Jens Vollinga Date: Fri Jul 31 17:54:16 2009 +0200 Fixed memory leak. ----------------------------------------------------------------------- Summary of changes: ginac/parser/parser.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) hooks/post-receive -- GiNaC -- a C++ library for symbolic computations From jensv at nikhef.nl Fri Jul 31 17:55:14 2009 From: jensv at nikhef.nl (Jens Vollinga) Date: Fri, 31 Jul 2009 17:55:14 +0200 Subject: [GiNaC-devel] [SCM] GiNaC -- a C++ library for symbolic computations branch, ginac_1-5, updated. release_1-4-0-198-g8bf0597 In-Reply-To: <20090731143827.GA3183@metalica.kh.ua> References: <20090731105027.2582E5B4045@cebix.net> <20090731115713.GA26845@metalica.kh.ua> <4A72E6FA.2060904@nikhef.nl> <20090731132332.GA29991@metalica.kh.ua> <4A72F205.1090908@nikhef.nl> <20090731143827.GA3183@metalica.kh.ua> Message-ID: <4A7313E2.2060605@nikhef.nl> Hi Alexei, Alexei Sheplyakov schrieb: > should be inserted here, otherwise we might leak memory if ->second is > a pointer to a (C++) function. thanks again! :-) Regards, Jens