|
|
Up |
|
|
  |
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Jul 11, 2006 07:46
> Hi all. I'm new to fortran. I've bought a book on Fortran 77 because
> the algorithm I'm dealing uses that. However the book I referred to
> does not seem to have the solution I'm looking for. It's about the
> 'write' statement.
> I know how to print an output using the 'print' and 'format' statements
> but this is what is found in the algorithm:
> write(*,'(20i6)') (i,i=1,nclass)
> print *
> Assuming i have nclass=5
> What does the statement above do? Does the 'i' mean 'integer'
> variable???
Personally, I don't like mixing WRITE and PRINT, though both are valid.
I believe that PRINT * is the same as WRITE(*,*), and not that much
more to type.
If someone wants to go through a program and make changes to all WRITE
statements, such as changing the unit number, they will miss PRINT
statements.
|
| Show full article (1.66Kb) |
|
| | 23 Comments |
|
  |
Author: Stephen PelcStephen Pelc Date: Aug 21, 2006 04:14
On Mon, 21 Aug 2006 09:03:46 +0200, Andreas Kochenburger
nospam.com> wrote:
>Some Forths use curly braces for multiline comments. instead of the
>ugly 0 [IF]
The interpretation semantics of { are undefined. The use of { for
comments was introduced by Forth Inc after the locals { as far as
I know. Their usage is always during interpretation. As far as
language lawyers are concerned, their is no conflict!
>I am comfortable with L( ... ) for defining locals. Also it resembles
>the stack annotation. And as other posted, braces are hard to read.
Existing practice in VFX Forth, Win32Forth, gForth and others
over many years is convincing.
>I see problems with output locals. In my previous experiments I
>noticed that they were seldom of practical use.
Everything after '--' is discarded and ignored. It's defined
so that formal comments can be used. I'll update the text.
Stephen
|
| Show full article (1.15Kb) |
|
| | no comments |
|
  |
Author: Stephen PelcStephen Pelc Date: Aug 21, 2006 07:20
On 21 Aug 2006 06:24:38 -0700, "GerryJ"
jackson9000.fsnet.co.uk> wrote:
>Stephen Pelc wrote:
>> Local arguments and variables return their values when referenced,
>> and must be preceded by TO to perform a store.
>
>If we're having local variables, why can't they leave their address on
>the stack so that @ and ! etc can be used as with global variables
>instead of TO. I would have thought consistency with globals was a
>definite thing to aim for.
Because that's what happens with LOCALS| ... | and it's common
practice in all current { ... } implementations.
Stephen
--
Stephen Pelc, stephenXXX@ mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads
|
| |
| 6 Comments |
|
  |
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Jul 11, 2006 18:15
robin wrote:
> glen herrmannsfeldt wrote in message ...
(snip)
>>CDC used ones complement,
> Yes, and they were a PITA.
> But they are long-gone machines, as I said; some 20 + years.
>>and as I understand it Univac still does.
No comment on this one? I don't know which compilers are
available for it, but it does seem to still be in production.
(snip)
>>S/360 and successors use sign magnitude for fixed point decimal
>>arithmetic.
> Off topic. We're referring to binary integers, not decimal
Why is it off topic? Fortran allows any base greater than one.
PL/I definitely allows decimal, most likely even for FIXED
BINARY variables. Someone else will have to say what ADA allows,
but those three groups are in the discussion, so those should
determine what is on topic.
-- glen
|
| |
| no comments |
|
  |
Author: Stephen PelcStephen Pelc Date: Aug 21, 2006 04:14
On Mon, 21 Aug 2006 09:03:46 +0200, Andreas Kochenburger
nospam.com> wrote:
>Some Forths use curly braces for multiline comments. instead of the
>ugly 0 [IF]
The interpretation semantics of { are undefined. The use of { for
comments was introduced by Forth Inc after the locals { as far as
I know. Their usage is always during interpretation. As far as
language lawyers are concerned, their is no conflict!
>I am comfortable with L( ... ) for defining locals. Also it resembles
>the stack annotation. And as other posted, braces are hard to read.
Existing practice in VFX Forth, Win32Forth, gForth and others
over many years is convincing.
>I see problems with output locals. In my previous experiments I
>noticed that they were seldom of practical use.
Everything after '--' is discarded and ignored. It's defined
so that formal comments can be used. I'll update the text.
Stephen
|
| Show full article (1.15Kb) |
| 2 Comments |
|
  |
Author: glen herrmannsfeldtglen herrmannsfeldt Date: Jul 13, 2006 12:37
Richard E Maine wrote:
(snip regarding array initialization)
> I have seen largish (for the time, which was a while ago) server systems
> brought to their knees by things like this. (Ok, I think it was in a
> DATA statement, but same idea).
It sounds pretty much the same in the standard, though the OP
asked for elegant. For a DATA statement I think you say 1000*42,
making it a little more obvious that 1000 42's are generated.
> I think one even crashed when it ran out
> of disk space on a system volume during compilation.
I once had hundreds of cards punched with binary zeros, which take
five holes each, punching an object program generated that way.
-- glen
|
| |
| 1 Comment |
|
  |
Author: Stephen PelcStephen Pelc Date: Aug 21, 2006 07:20
On 21 Aug 2006 06:24:38 -0700, "GerryJ"
jackson9000.fsnet.co.uk> wrote:
>Stephen Pelc wrote:
>> Local arguments and variables return their values when referenced,
>> and must be preceded by TO to perform a store.
>
>If we're having local variables, why can't they leave their address on
>the stack so that @ and ! etc can be used as with global variables
>instead of TO. I would have thought consistency with globals was a
>definite thing to aim for.
Because that's what happens with LOCALS| ... | and it's common
practice in all current { ... } implementations.
Stephen
--
Stephen Pelc, stephenXXX@ mpeforth.com
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads
|
| |
| no comments |
|
  |
Author: Stephen PelcStephen Pelc Date: Aug 22, 2006 02:42
On 21 Aug 2006 16:04:53 -0700, "Alex McDonald"
btopenworld.com> wrote:
>> Agree with the above, and would add
>>
>> 5) Current implementations of { are diverging in the facilities they
>> provide.
It's the function of a standard to encourage people to use the
same names for the same function, but it is not the purpose to
stop new facilities being added to implementations.
>> 6) { and } are visually confusing. Perhaps select another character or
>> string, which would allow existing implementations to do their own
>> thing unmolested.
Common practice is to use { ... }. Is changing a name in common use
because we need new glasses or bigger monitors good enough reason
for change?
|
| Show full article (2.26Kb) |
| no comments |
|
  |
Author: Stephen PelcStephen Pelc Date: Aug 22, 2006 02:42
On 21 Aug 2006 16:04:53 -0700, "Alex McDonald"
btopenworld.com> wrote:
>> Agree with the above, and would add
>>
>> 5) Current implementations of { are diverging in the facilities they
>> provide.
It's the function of a standard to encourage people to use the
same names for the same function, but it is not the purpose to
stop new facilities being added to implementations.
>> 6) { and } are visually confusing. Perhaps select another character or
>> string, which would allow existing implementations to do their own
>> thing unmolested.
Common practice is to use { ... }. Is changing a name in common use
because we need new glasses or bigger monitors good enough reason
for change?
|
| Show full article (2.26Kb) |
| 6 Comments |
|
  |
|
|
  |
|
Author: Thomas KoenigThomas Koenig Date: Jul 15, 2006 05:21
|
| |
| 1 Comment |
|
|
|
|