Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Chris Angelico
On Tue, Feb 3, 2015 at 5:34 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: On 02/02/2015 17:25, Chris Angelico wrote: On Tue, Feb 3, 2015 at 3:52 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I'd like to see anybody define 'a' and 'the' without using 'a' and 'the'. Would that be

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread beliavsky
On Friday, January 30, 2015 at 5:51:38 PM UTC-5, Gregory Ewing wrote: Michael Torrie wrote: On 01/30/2015 10:31 AM, Rustom Mody wrote: And what about the grey area between lightweight and heavyweight? That's what the smart pointers are for. I'd say it's what higher-level languages

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Paul Rudin
Marko Rauhamaa ma...@pacujo.net writes: Chris Angelico ros...@gmail.com: On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: And there are underspecified rules too. What is the plural of octopus? No fair looking it up in the dictionary. Standard

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Paul Rudin paul.nos...@rudin.co.uk: Marko Rauhamaa ma...@pacujo.net writes: Your brain's grammar engine will give you the correct answer. It may not match your English teacher's answer, but the language we are talking about is not standard English but the dialect you have acquired in

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Mark Lawrence
On 02/02/2015 04:47, Chris Angelico wrote: On Mon, Feb 2, 2015 at 3:14 PM, Roy Smith r...@panix.com wrote: In article 54ceda0b$0$12977$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: What is the plural of octopus? It's a trick question.

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Rustom Mody
On Monday, February 2, 2015 at 9:40:35 PM UTC+5:30, Mark Lawrence wrote: On 02/02/2015 08:52, Marko Rauhamaa wrote: Chris Angelico : On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano wrote: And there are underspecified rules too. What is the plural of octopus? No fair looking it up in

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Mark Lawrence
On 02/02/2015 16:21, Rustom Mody wrote: On Monday, February 2, 2015 at 9:40:35 PM UTC+5:30, Mark Lawrence wrote: On 02/02/2015 08:52, Marko Rauhamaa wrote: Chris Angelico : On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano wrote: And there are underspecified rules too. What is the plural of

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Mark Lawrence
On 02/02/2015 08:52, Marko Rauhamaa wrote: Chris Angelico ros...@gmail.com: On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: And there are underspecified rules too. What is the plural of octopus? No fair looking it up in the dictionary. Standard

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Michael Torrie
On 02/02/2015 12:39 AM, Marko Rauhamaa wrote: Michael Torrie torr...@gmail.com: http://en.cppreference.com/w/cpp/utility/functional/function Thus if we were to shoehorn your example into C++, the result would be idiomatically very similar to what you have in your Python code. I can

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Michael Torrie
On 02/02/2015 10:57 AM, Marko Rauhamaa wrote: I really don't understand why you are taking all of this so personally. We are just discussing different aspects of different programming languages. Fair enough. You raise good points. I am not taking it personally; your emails, lacking emotional

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Mark Lawrence
On 02/02/2015 17:25, Chris Angelico wrote: On Tue, Feb 3, 2015 at 3:52 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I'd like to see anybody define 'a' and 'the' without using 'a' and 'the'. Would that be formally rigorous or rigorously formal? a: Indefinite article, used to represent

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Michael Torrie torr...@gmail.com: Fair enough. You raise good points. I am not taking it personally; your emails, lacking emotional context, just seemed a bit unnecessarily argumentative. For example, The cherry on top: _1! The C++ compiler figures out template types heroically but can't

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Michael Torrie torr...@gmail.com: You have no intention of being impressed with C++, let alone simply learn about it. I am fully open to being impressed. I have more than a decade of C++ programming under my belt, although not much for the past few years. There's no possible way for the

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Chris Angelico
On Tue, Feb 3, 2015 at 3:52 AM, Mark Lawrence breamore...@yahoo.co.uk wrote: I'd like to see anybody define 'a' and 'the' without using 'a' and 'the'. Would that be formally rigorous or rigorously formal? a: Indefinite article, used to represent individual objects not otherwise identifiable.

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: Steven D'Aprano wrote: Of course people make grammar mistakes that they don't spot. Ironically, this is one of them. It should of course be grammatical mistakes. I don't believe you made a mistake according to your brain's grammar

Re: [OT] fortran lib which provide python like data type

2015-02-02 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com: On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: And there are underspecified rules too. What is the plural of octopus? No fair looking it up in the dictionary. Standard and well-known piece of trivia, and there

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Christian Gollwitzer
Am 01.02.15 um 08:58 schrieb Marko Rauhamaa: Paul Rubin no.email@nospam.invalid: Marko Rauhamaa ma...@pacujo.net writes: Stroustrup apparently has never had to deal with callbacks; his thick books never made a mention of them last time I checked. C++ has function pointers just like C,

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Marko Rauhamaa
Paul Rubin no.email@nospam.invalid: Marko Rauhamaa ma...@pacujo.net writes: Stroustrup apparently has never had to deal with callbacks; his thick books never made a mention of them last time I checked. C++ has function pointers just like C, Et tu, Brute! C's callbacks always use a void

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Steven D'Aprano
Marko Rauhamaa wrote: The natural language has a rigorous grammar plus a lexicon that includes a number of idioms. Nobody has so far been able to codify a natural language completely because the rigorous grammar consists of maybe 10,000 rules. If nobody has codified the rigorous grammar, how

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Marko Rauhamaa
Christian Gollwitzer aurio...@gmx.de: Am 01.02.15 um 08:58 schrieb Marko Rauhamaa: Qt gave up on C++ when it comes to callbacks (signals) and went for an apocryphal metacompiler. Yes, but only because C++ compilers were not good enough when QT came out, and later is was too late to change

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Marko Rauhamaa
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: Marko Rauhamaa wrote: The natural language has a rigorous grammar plus a lexicon that includes a number of idioms. Nobody has so far been able to codify a natural language completely because the rigorous grammar consists of maybe 10,000

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Michael Torrie
On 02/01/2015 12:12 PM, Marko Rauhamaa wrote: Christian Gollwitzer aurio...@gmx.de: Am 01.02.15 um 08:58 schrieb Marko Rauhamaa: Qt gave up on C++ when it comes to callbacks (signals) and went for an apocryphal metacompiler. Yes, but only because C++ compilers were not good enough when QT

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Michael Torrie
On 02/01/2015 12:12 PM, Marko Rauhamaa wrote: So please implement this small piece of Python code in C++ so we can compare the idioms: So I though I might just for kicks code up a C++ version. In doing so, I realized that idomatically, this particular example would not really use callbacks in

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Michael Torrie
On 02/01/2015 05:50 PM, Michael Torrie wrote: Honestly with the C++ standard library implementing std::function and std::bind macros, idiomatically it would look very much similar to the Python code you showed. Make that templates, not macros. --

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Roy Smith
In article mailman.18388.1422845124.18130.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: On Mon, Feb 2, 2015 at 1:35 PM, Matthew Barnett auxl...@mrabarnett.plus.com wrote: And the plural of virus is viruses, not viri (that's the plural of vir) or virii (that would be the

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Roy Smith
In article 54ceda0b$0$12977$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: What is the plural of octopus? It's a trick question. Octopus is already plural. Monopus is singular. -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Steven D'Aprano
Marko Rauhamaa wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info: Marko Rauhamaa wrote: The natural language has a rigorous grammar plus a lexicon that includes a number of idioms. Nobody has so far been able to codify a natural language completely because the rigorous grammar

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Chris Angelico
On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: And there are underspecified rules too. What is the plural of octopus? No fair looking it up in the dictionary. Standard and well-known piece of trivia, and there are several options. Octopodes is one

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Matthew Barnett
On 2015-02-02 02:04, Chris Angelico wrote: On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: And there are underspecified rules too. What is the plural of octopus? No fair looking it up in the dictionary. Standard and well-known piece of trivia, and

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Steven D'Aprano
Steven D'Aprano wrote: Of course people make grammar mistakes that they don't spot. Ironically, this is one of them. It should of course be grammatical mistakes. Seriously, I didn't do that on purpose. I only noticed the error on reading it back after sending. -- Steven --

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Chris Angelico
On Mon, Feb 2, 2015 at 1:35 PM, Matthew Barnett auxl...@mrabarnett.plus.com wrote: And the plural of virus is viruses, not viri (that's the plural of vir) or virii (that would be the plural of virius, if it existed). Yes indeed.Virii and octopi are as wrong as hice for houses (paralleling

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Marko Rauhamaa
Michael Torrie torr...@gmail.com: http://en.cppreference.com/w/cpp/utility/functional/function Thus if we were to shoehorn your example into C++, the result would be idiomatically very similar to what you have in your Python code. I can understand why you wouldn't write out my example in

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Steven D'Aprano
Chris Angelico wrote: On Mon, Feb 2, 2015 at 12:59 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: And there are underspecified rules too. What is the plural of octopus? No fair looking it up in the dictionary. Standard and well-known piece of trivia, and there are several

Re: [OT] fortran lib which provide python like data type

2015-02-01 Thread Chris Angelico
On Mon, Feb 2, 2015 at 3:14 PM, Roy Smith r...@panix.com wrote: In article 54ceda0b$0$12977$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: What is the plural of octopus? It's a trick question. Octopus is already plural. Monopus is singular.

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Rustom Mody
On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: Esthetically, I'm most impressed with Scheme. One day it might give Python a run for its money. Marko Aren't you getting this backwards?

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Rustom Mody
On Saturday, January 31, 2015 at 4:34:14 PM UTC+5:30, Steven D'Aprano wrote: Yesterday, as I wrote that message, my web browser crashed *eight times* in a matter of half an hour. There are thousands of serious security vulnerabilities due to mishandled pointers. Anyone who thinks that Linux

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Christian Gollwitzer
Am 30.01.15 um 19:23 schrieb Paul Rubin: Michael Torrie torr...@gmail.com writes: Follow basic [C++] rules and 99% of segfaults will never happen and the majority of leaks will not happen either. That is a safe and simple approach, but it works by copying data all over the place instead of

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Mark Lawrence
On 31/01/2015 15:50, Rustom Mody wrote: On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: Esthetically, I'm most impressed with Scheme. One day it might give Python a run for its money. Marko Aren't you getting this backwards?

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Marko Rauhamaa
Rustom Mody rustompm...@gmail.com: On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: Esthetically, I'm most impressed with Scheme. One day it might give Python a run for its money. Aren't you getting this backwards? Deep down I'm a minimalist romantic. Its just

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Steven D'Aprano
Marko Rauhamaa wrote: I'm most impressed with Scheme. One day it might give Python a run for its money. Scheme is forty years old, having come out in 1975. Python is 24 years old, having come out in 1991. If Scheme hasn't caught up with Python by now, it never will. -- Steven --

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Marko Rauhamaa
Rustom Mody rustompm...@gmail.com: There is a real conflict between the logician's goal and the educator's. The logician wants to minimize the variety of ideas, and doesn't mind a long, thin path. The educator (rightly) wants to make the paths short and doesn't mind–in fact,

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Rustom Mody
On Saturday, January 31, 2015 at 11:13:29 PM UTC+5:30, Marko Rauhamaa wrote: Rustom Mody: On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: Esthetically, I'm most impressed with Scheme. One day it might give Python a run for its money. Aren't you getting this

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Paul Rubin
Marko Rauhamaa ma...@pacujo.net writes: The guiding principle in C++ language development is to take static type safety to the extreme. Heh, try Ada. Stroustrup apparently has never had to deal with callbacks; his thick books never made a mention of them last time I checked. C++ has

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Steven D'Aprano
Michael Torrie wrote: On 01/30/2015 04:50 PM, Steven D'Aprano wrote: Oh great. So if the average application creates a hundred thousand pointers of the course of a session, you'll only have a thousand or so seg faults and leaks. Well, that certainly explains this:

Re: [OT] fortran lib which provide python like data type

2015-01-31 Thread Marko Rauhamaa
Gregory Ewing greg.ew...@canterbury.ac.nz: I'm completely convinced nowadays that there is *no* use case for C++. While I wouldn't go quite that far (my most recent creation was written in C++; why? because the legacy support libraries were written in C++). However, C++ is like putting

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Rustom Mody
On Friday, January 30, 2015 at 1:03:03 PM UTC+5:30, Christian Gollwitzer wrote: Am 30.01.15 um 02:40 schrieb Rustom Mody: FORTRAN use dictionary type(dictionary), pointer :: d d=dict_new() call set(d//'toto',1) v = d//'toto' call dict_free(d) The corresponding python

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 09:27 AM, Rustom Mody wrote: ... if I restate that in other words it says that sufficiently complex data structures will be beyond the reach of the standard RAII infrastructure. Of course this only brings up one side of memory-mgmt problems viz. unreclaimable memory. What

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Sturla Molden
Michael Torrie torr...@gmail.com wrote: Yes I can tell you haven't used C++. Compared to C, I've always found memory management in C++ to be quite a lot easier. The main reason is that C++ guarantees objects will be destroyed when going out of scope. So when designing a class, you put any

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Gregory Ewing
Michael Torrie wrote: On 01/30/2015 10:31 AM, Rustom Mody wrote: And what about the grey area between lightweight and heavyweight? That's what the smart pointers are for. I'd say it's what higher-level languages are for. :-) I'm completely convinced nowadays that there is *no* use case

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Rustom Mody
On Friday, January 30, 2015 at 10:39:12 PM UTC+5:30, Michael Torrie wrote: On 01/30/2015 09:27 AM, Rustom Mody wrote: ... if I restate that in other words it says that sufficiently complex data structures will be beyond the reach of the standard RAII infrastructure. Of course this only

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 10:31 AM, Rustom Mody wrote: And what about the grey area between lightweight and heavyweight? That's what the smart pointers are for. You say just use copy constructors and no pointers. Can you (ie C++) guarantee that no pointer is ever copied out of scope of these

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Paul Rubin
Michael Torrie torr...@gmail.com writes: Follow basic [C++] rules and 99% of segfaults will never happen and the majority of leaks will not happen either. That is a safe and simple approach, but it works by copying data all over the place instead of passing pointers, resulting in performance

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Steven D'Aprano
Michael Torrie wrote: If that happened, then it's because you the programmer wanted it to happen.  It's not just going to happen all by itself.  Yes anytime pointers are allowed, things are potentially unsafe in the hands of a programmer.  I'm just saying it's not nearly so bad as you make it

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Steven D'Aprano
Gregory Ewing wrote: I'm completely convinced nowadays that there is no use case for C++. I can think of one use-case for C++. You walk up to somebody in the street, say I wrote my own C++ parser!, and while they are gibbering and shaking in shock, you rifle through their pockets and steal

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 04:50 PM, Steven D'Aprano wrote: Oh great. So if the average application creates a hundred thousand pointers of the course of a session, you'll only have a thousand or so seg faults and leaks. Well, that certainly explains this: https://access.redhat.com/articles/1332213 I

Re: [OT] fortran lib which provide python like data type

2015-01-30 Thread Michael Torrie
On 01/30/2015 04:12 PM, Sturla Molden wrote: Michael Torrie torr...@gmail.com wrote: Yes I can tell you haven't used C++. Compared to C, I've always found memory management in C++ to be quite a lot easier. The main reason is that C++ guarantees objects will be destroyed when going out of

[OT] fortran lib which provide python like data type

2015-01-29 Thread 1989lzhh
Hi, I am not sure here is the right place to ask this question, but I want to give it a shot:) are there fortran libs providing python like data type, such as set, dict, list? Thanks, Yours liuzhenhai -- https://mail.python.org/mailman/listinfo/python-list

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread beliavsky
On Thursday, January 29, 2015 at 10:01:00 AM UTC-5, Liu Zhenhai wrote: Hi, I am not sure here is the right place to ask this question, but I want to give it a shot:) are there fortran libs providing python like data type, such as set, dict, list? Thanks, Yours liuzhenhai The Fortran

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread Rustom Mody
On Friday, January 30, 2015 at 4:09:19 AM UTC+5:30, beli...@aol.com wrote: On Thursday, January 29, 2015 at 10:01:00 AM UTC-5, Liu Zhenhai wrote: Hi, I am not sure here is the right place to ask this question, but I want to give it a shot:) are there fortran libs providing python like

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread Christian Gollwitzer
Am 30.01.15 um 02:40 schrieb Rustom Mody: FORTRAN use dictionary type(dictionary), pointer :: d d=dict_new() call set(d//'toto',1) v = d//'toto' call dict_free(d) The corresponding python d = dict() d['toto'] = 1 v = d['toto'] del(d) In particular note the del in the