OFF-TOPIC: Algol 60 guru required
Dear All! Sorry for this off-topic, but I could not see any solution to my problem. I'm trying to transform old Algol 60 program to C++. I can understand every syntax of it except this construction: D(N+1):=N(N+2):=0.0; Variables types: N - INTEGER D - REAL ARRAY What is it? How to represent in C++? Hope on this list there's people, who could remember that from the time... Thanks in advance! -- Hiisi. Registered Linux User #487982. Be counted at: http://counter.li.org/ -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On 08/03/2009 02:58 PM, Hiisi wrote: Dear All! Sorry for this off-topic, but I could not see any solution to my problem. I'm trying to transform old Algol 60 program to C++. I can understand every syntax of it except this construction: D(N+1):=N(N+2):=0.0; Variables types: N - INTEGER D - REAL ARRAY What is it? How to represent in C++? Hope on this list there's people, who could remember that from the time... Thanks in advance! -- Hiisi. Registered Linux User #487982. Be counted at: http://counter.li.org/ i used to do a little spl (hp), to me, i'd says its a dual initialization where d(n+1) is being set equal to n(n+2) and each are set to 0. just awag, good luck, jackc... -- jack craig ja...@linuxlighthouse.com 831-684-1375 (Office) 831-596-6924 (cell) IM: jackcraigaptos (AIM) _ This email has been ClamScanned ! www.LinuxLightHouse.com -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On Mon, 2009-08-03 at 15:23 -0700, jack craig wrote: > On 08/03/2009 02:58 PM, Hiisi wrote: > > Dear All! > > Sorry for this off-topic, but I could not see any solution to my > > problem. I'm trying to transform old Algol 60 program to C++. I can > > understand every syntax of it except this construction: > > D(N+1):=N(N+2):=0.0; > > > > Variables types: > > N - INTEGER > > D - REAL ARRAY > > What is it? How to represent in C++? Hope on this list there's people, > > who could remember that from the time... > > Thanks in advance! > > -- > > Hiisi. > > Registered Linux User #487982. Be counted at: http://counter.li.org/ > > > i used to do a little spl (hp), to me, i'd says its a dual > initialization where d(n+1) is being set equal to n(n+2) and each are > set to 0. How can N(N+2) be legal, if N is simply an integer? poc -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On 08/03/2009 05:58 PM, Hiisi wrote: > Dear All! > Sorry for this off-topic, but I could not see any solution to my > problem. I'm trying to transform old Algol 60 program to C++. I can > understand every syntax of it except this construction: > D(N+1):=N(N+2):=0.0; > > Variables types: > N - INTEGER > D - REAL ARRAY > What is it? How to represent in C++? Hope on this list there's people, > who could remember that from the time... > Thanks in advance! Classic ALGOL-60 requires that a subscript-list be enclosed in square brackets. I would expect your statement should read: D[N+1]:=N[N+2]:=0.0; But this doesn't answer the question of N. Is it an INTEGER scalar? INTEGER array? INTEGER procedure? Its the N(N+2) part that bothers me. The actual definitions of D and N would help here. An assignment statement is defined as: and a left-part-list is one or more := where each variable in the receives the value of the . BTW, I'm just curious how you're handling the "pass by name" stuff > -- > Hiisi. > Registered Linux User #487982. Be counted at: http://counter.li.org/ > -- Kevin J. Cummings kjch...@rcn.com cummi...@kjchome.homeip.net cummi...@kjc386.framingham.ma.us Registered Linux User #1232 (http://counter.li.org) -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On Tue, 2009-08-04 at 01:58 +0400, Hiisi wrote: > Dear All! > Sorry for this off-topic, but I could not see any solution to my > problem. I'm trying to transform old Algol 60 program to C++. I can > understand every syntax of it except this construction: > D(N+1):=N(N+2):=0.0; > > Variables types: > N - INTEGER > D - REAL ARRAY > What is it? How to represent in C++? Hope on this list there's people, > who could remember that from the time... > Thanks in advance! Something is very hokey here. At first glance it looks like a double assignment. However Algol requires arrays to be specified and used with square brackets. So "D(N+1)" looks like it's meaningless since D is declared to be an array; the form could be either a function or a product, depending on how D is declared. "N(N+1)" has to be a product. But neither of them is an l-value -- they can't be assigned to. There's a small example of Algol-60 at: http://en.wikipedia.org/wiki/Trabb_Pardo-Knuth_algorithm -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
From: "Kevin J. Cummings" Classic ALGOL-60 requires that a subscript-list be enclosed in square brackets. I would expect your statement should read: D[N+1]:=N[N+2]:=0.0; But this doesn't answer the question of N. Is it an INTEGER scalar? INTEGER array? INTEGER procedure? Its the N(N+2) part that bothers me. The actual definitions of D and N would help here. An assignment statement is defined as: and a left-part-list is one or more := where each variable in the receives the value of the . First of all, thanks everybody for your responses. Here's a fragment of the initial code: PROCEDURE QUINEQ(INTEGER VALUE N1,N2; REAL ARRAY Y,B,C,D,E,F(*)); IF N2>N1+1 THEN BEGIN INTEGER N; REAL P,Q,R,S,T,U,V; N:=N2-3; P:=Q:=R:=S:=T:=0.0; FOR I:=N1 STEP 1 UNTIL N DO BEGIN U:=P*R; B(I):=1.0/(66.0-U*R-Q); C(I):=R:=26.0-U; D(I):=Y(I+3)-3.0*(Y(I+2)-Y(I+1))-Y(I)-U*S-Q*T; Q:=P; P:=B(I); T:=S; S:=D(I) END I; D(N+1):=N(N+2):=0.0; And quotation from paper (year of publication: 1976), that describes the algorithm: "These procedures have been tested in Algol 60 on the Telefunken TR-440 computer at the Leibniz-Rechenzentrum of the Bavarian Academy of Sciences, Munich, and in Algol W on the I B M 360/67 at the Stanford Center for Information Processing." It's accessible here: http://portal.acm.org/citation.cfm?id=355694.355701 BTW, I'm just curious how you're handling the "pass by name" stuff I had little problem with modification of it. I just auto-replaced 'PROCEDURE' to 'void', 'BEGIN' to '{', and so on. Then I had only to change by hand FOR and IF-constructions, that is: FOR I:=N STEP -1 UNTIL N1 DO IF N2>N1+1 THEN -- Hiisi. Registered Linux User #487982. Be counted at: http://counter.li.org/ -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On 08/04/2009 08:28 AM, Hiisi wrote: D(N+1):=N(N+2):=0.0; ... It's accessible here: http://portal.acm.org/citation.cfm?id=355694.355701 Maybe a mistyping in the .gz file on that page? Is the original code published in CACM available as a PDF file somewhere? Mogens -- Mogens Kjaer, Carlsberg A/S, Computer Department Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25 Email: m...@crc.dk Homepage: http://www.crc.dk -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On Tue, 2009-08-04 at 10:28 +0400, Hiisi wrote: > Here's a fragment of the initial code: > PROCEDURE QUINEQ(INTEGER VALUE N1,N2; REAL ARRAY Y,B,C,D,E,F(*)); >IF N2>N1+1 THEN >BEGIN > INTEGER N; > REAL P,Q,R,S,T,U,V; > N:=N2-3; P:=Q:=R:=S:=T:=0.0; > FOR I:=N1 STEP 1 UNTIL N DO > BEGIN > U:=P*R; B(I):=1.0/(66.0-U*R-Q); > C(I):=R:=26.0-U; > D(I):=Y(I+3)-3.0*(Y(I+2)-Y(I+1))-Y(I)-U*S-Q*T; > Q:=P; P:=B(I); T:=S; S:=D(I) > END I; > D(N+1):=N(N+2):=0.0; > And quotation from paper (year of publication: 1976), that describes > the algorithm: "These procedures have been tested in Algol 60 on the > Telefunken TR-440 computer at the Leibniz-Rechenzentrum of the > Bavarian Academy of Sciences, Munich, and in Algol W on the I B M > 360/67 at the Stanford Center for Information > Processing." > It's accessible here: > http://portal.acm.org/citation.cfm?id=355694.355701 -> 507.gz The same function is available in FORTRAN at: http://portal.acm.org/citation.cfm?doid=357456.357465 -> 600.gz These pages refer to the actual papers as .pdf files and to the algorithms as .gz files, both downloadable. The FORTRAN implementation doesn't seem to have the perplexing line in it at all (if present it would be around line 296 of the FORTRAN). I suspect that the line is a typo, and should read: D(N+1):=D(N+2):=0.0; or some such thing. It appears to be initialization for the following lines, which are: FOR I:=N STEP -1 UNTIL N1 DO D(I):=(D(I)-C(I)*D(I+1)-D(I+2))*B(I); The FORTRAN takes advantage of the fact that (if my rusty FORTRAN is correct) in FORTRAN arrays are initialized to 0.0 by the run time system, so the initialization is not necessary. To verify all this someone will have to take a careful look at the original math in the .pdf files. (Fun, but *really* OT.) -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On Mon, 2009-08-03 at 15:23 -0700, jack craig wrote: > On 08/03/2009 02:58 PM, Hiisi wrote: > > Dear All! > > Sorry for this off-topic, but I could not see any solution to my > > problem. I'm trying to transform old Algol 60 program to C++. I can > > understand every syntax of it except this construction: > > D(N+1):=N(N+2):=0.0; > > > > Variables types: > > N - INTEGER > > D - REAL ARRAY > > What is it? How to represent in C++? Hope on this list there's people, > > who could remember that from the time... > > Thanks in advance! > > -- > > Hiisi. > > Registered Linux User #487982. Be counted at: http://counter.li.org/ > > > i used to do a little spl (hp), to me, i'd says its a dual > initialization where d(n+1) is being set equal to n(n+2) and each are > set to 0. That would be ok if N was not an integer. I think the OP is asking for the meaning of N(N+2) when N is an integer. It is not multiplication of N and N+2 because multiplication in ALGOL is represented by a * or a special X like symbol. So this expression is indeed confusing. > -- === Clones are people two. === Aaron Konstam telephone: (210) 656-0355 e-mail: akons...@sbcglobal.net -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On Mon, 2009-08-03 at 19:42 -0400, Kevin J. Cummings wrote: > On 08/03/2009 05:58 PM, Hiisi wrote: > > Dear All! > > Sorry for this off-topic, but I could not see any solution to my > > problem. I'm trying to transform old Algol 60 program to C++. I can > > understand every syntax of it except this construction: > > D(N+1):=N(N+2):=0.0; > > > > Variables types: > > N - INTEGER > > D - REAL ARRAY > > What is it? How to represent in C++? Hope on this list there's people, > > who could remember that from the time... > > Thanks in advance! > > Classic ALGOL-60 requires that a subscript-list be enclosed in square > brackets. I would expect your statement should read: > > D[N+1]:=N[N+2]:=0.0; > > But this doesn't answer the question of N. Is it an INTEGER scalar? > INTEGER array? INTEGER procedure? Its the N(N+2) part that bothers me. > > The actual definitions of D and N would help here. > > An assignment statement is defined as: > > > > and a left-part-list is one or more > > := > > where each variable in the receives the value of the > . > > BTW, I'm just curious how you're handling the "pass by name" stuff > > > -- > > Hiisi. > > Registered Linux User #487982. Be counted at: http://counter.li.org/ > > > > > -- > Kevin J. Cummings > kjch...@rcn.com > cummi...@kjchome.homeip.net > cummi...@kjc386.framingham.ma.us > Registered Linux User #1232 (http://counter.li.org) > I don't know if many folks these days are familiar with the "pass by name" operation. Such code these days is generally not implemented due to the MANY serious issues with security, and most languages don't have any implementation for it (other than some runtime object language approximations using overloading to approximate it), and some list processing languages like Clisp. Anyway for the uninitiated, here is a fair explanation of how it works: http://www.cs.sfu.ca/~cameron/Teaching/383/PassByName.html I was going to write a C example, but I am just too rusty in Algol to be sure I coded it correctly. However, the Thunk method as shown using PASCAL is one method of implementing pass by value. Regards, Les H -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
Date: Tue, 04 Aug 2009 08:46:14 +0200 From: Mogens Kjaer Subject: Re: OFF-TOPIC: Algol 60 guru required To: "Community assistance, encouragement, and advice for using Fedora." Message-ID: <4a77d936.10...@crc.dk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed On 08/04/2009 08:28 AM, Hiisi wrote: > D(N+1):=N(N+2):=0.0; ... > It's accessible here: http://portal.acm.org/citation.cfm?id=355694.355701 Maybe a mistyping in the .gz file on that page? Is the original code published in CACM available as a PDF file somewhere? Mogens It isn't. Or at least I couldn't find it. Date: Tue, 04 Aug 2009 01:20:09 -0700 From: Jonathan Ryshpan The same function is available in FORTRAN at: http://portal.acm.org/citation.cfm?doid=357456.357465 -> 600.gz These pages refer to the actual papers as .pdf files and to the algorithms as .gz files, both downloadable. The FORTRAN implementation doesn't seem to have the perplexing line in it at all (if present it would be around line 296 of the FORTRAN). I suspect that the line is a typo, and should read: D(N+1):=D(N+2):=0.0; or some such thing. It appears to be initialization for the following lines, which are: FOR I:=N STEP -1 UNTIL N1 DO D(I):=(D(I)-C(I)*D(I+1)-D(I+2))*B(I); The FORTRAN takes advantage of the fact that (if my rusty FORTRAN is correct) in FORTRAN arrays are initialized to 0.0 by the run time system, so the initialization is not necessary. To verify all this someone will have to take a careful look at the original math in the .pdf files. (Fun, but *really* OT.) You're right. And the person, who needs to verify all this is me. I just was trying to do it easy. Now I understand - it's impossible. Need to write the whole program from scratch. By the way, I also have to use another algorithm. The initial procedure builds quintic natural spline. Semi-local smoothing spline would suit better to my task. But that's too more as for this list, as for this off-topic thread... -- Hiisi. Registered Linux User #487982. Be counted at: http://counter.li.org/ -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
I don't know if many folks these days are familiar with the "pass by name" operation. Such code these days is generally not implemented due to the MANY serious issues with security, and most languages don't have any implementation for it (other than some runtime object language approximations using overloading to approximate it), and some list processing languages like Clisp. Anyway for the uninitiated, here is a fair explanation of how it works: http://www.cs.sfu.ca/~cameron/Teaching/383/PassByName.html I was going to write a C example, but I am just too rusty in Algol to be sure I coded it correctly. However, the Thunk method as shown using PASCAL is one method of implementing pass by value. Regards, Les H I didn't understand initially what "pass by name means". Probably had to look more careful at the program. Doesn't matter any more. I need to do a statement: this thread is closed from now. Ones more: thanks everybody for your responses! -- Hiisi. Registered Linux User #487982. Be counted at: http://counter.li.org/ -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On 08/04/2009 03:48 PM, Hiisi wrote: >> I don't know if many folks these days are familiar with the "pass by >> name" operation. Such code these days is generally not implemented > I didn't understand initially what "pass by name means". Probably had to > look more careful at the program. I didn't think you did. Its a common mistake made by people trying to port ALGOL-60 programs who don't understand ALGOL-60 semantics. I just wanted you to be aware since you were porting to C++ and you could have inadvertently introduced bugs if you had incorrectly re-coded any semantic which relied on the pass-by-name convention of argument passing in some other section of the code. "pass by reference" and "pass by value" are the 2 semantics implemented by most modern programming languages, and you chose one of the few old languages which does "pass by name" instead. > Doesn't matter any more. I need to do a statement: this thread is closed > from now. Ones more: thanks everybody for your responses! Good luck with your new code. -- Kevin J. Cummings kjch...@rcn.com cummi...@kjchome.homeip.net cummi...@kjc386.framingham.ma.us Registered Linux User #1232 (http://counter.li.org) -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines
Re: OFF-TOPIC: Algol 60 guru required
On 08/04/2009 09:03 PM, Les wrote: ... I was going to write a C example, but I am just too rusty in Algol to be sure I coded it correctly. However, the Thunk method as shown using PASCAL is one method of implementing pass by value. If you want to run ALGOL programs, I'll suggest the ALGOL compiler written for the Danish GIER machine in the start of the 1960-ies. I've written a simulator for this machine (requires openmotif-devel to compile): http://www.datamuseum.dk/site_dk/rc/giersimulator/ Mogens -- Mogens Kjaer, Carlsberg A/S, Computer Department Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25 Email: m...@crc.dk Homepage: http://www.crc.dk -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines