-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grouping numbers with spaces in free form #311
Comments
@tkoenig1 wrote Aug. 5, 2023 5:53 PM EDT:
It will be great if you @tkoenig1 can draft a proposal in the J3 paper format and post it here: These are the kind of proposals toward which WG5 must show vision to address and open up a "lane" for fast and easy discussion and ready acceptance into the Fortran standard. One should not have to wait 5 to 10 years. |
For namelist files, it has different interpretations for arrays? program main
implicit none
integer :: arr(3), inp
namelist /param/ arr
open(newunit=inp, file="param.dat", status="old")
arr(:) = 0
read(inp, nml=param)
print *, arr(:) !! 1 200 0
close(inp)
end
!! param.dat
¶m
arr = 1 200 000
!! (The above line is the same as)
!! arr = 1, 200, 000
!! arr(1:3) = 1, 200, 000
/ Using double underscores (like |
This would've been handy for me in the past, when copying routines from Julia. |
Are you implying some corollary to the jaded disclaimer, "past performance is no guarantee of future results"!!!? Since"(t)his would've been handy for" you "in the past", can a reader see this as useful in the future too? or not?! |
Sorry I was unclear. I once did a porting of the Julia's
The grouping absolutely helps guide the eye when entering digits by hand, and it would save me the effort of deleting the underscores. I'd appreciate having it in the future. Python allows grouping digits too:
Using a different symbol than |
One could argue that Python and Julia introduced the friction by deviating from Fortran's prior use of |
There are two advantages of fixed form: First, it makes it possible to write
for those who prefer British spelling, and it offers the possibility of
grouping numbers, like
The first advantage is not really big, but the second one is actually a serious use case when trying not to lose count of digits.
So, a syntax to allow grouping of numbers would come in handy. Other languages have underscores, but that is already taken in Fortran for
KIND
. But what about actually allowing spaces in free form in numbers?The text was updated successfully, but these errors were encountered: