webpage icon indicating copy to clipboard operation
webpage copied to clipboard

Improve formatting of examples in intrinsics section

Open Beliavsky opened this issue 1 year ago • 1 comments

At https://fortran-lang.org/learn/intrinsics/array/#merge there is code

   write(*,*)merge (1.0, 0.0, k > 0)
   k=-2
   write(*,*)merge (1.0, 0.0, k > 0)

I think there should be a space after write(*,*) and should not be a space between a function name and its arguments, so the code should be

   write(*,*) merge(1.0, 0.0, k > 0)
   k = -2
   write(*,*) merge(1.0, 0.0, k > 0)

I think there should be spaces around equal signs but not just after opening brackets or just before closing brackets, so that

   tvals(1,:)=[  10, -60,  50 ]
   tvals(2,:)=[ -20,  40, -60 ]

becomes

   tvals(1,:) = [10, -60,  50]
   tvals(2,:) = [-20,  40, -60]

Ideally all code would be run through an auto-formatter to achieve this instead of having us fiddle with the code manually.

Beliavsky avatar Apr 08 '24 21:04 Beliavsky

i would like to work on this issue please assign this to me @Beliavsky

RaheelaTabassum avatar Nov 12 '24 05:11 RaheelaTabassum