Silverfrost Forums

Welcome to our forums

compile time evaluation

12 Dec 2025 2:33 #32548

Paul, F2008 permits some calculations to be made at compile time. Here is an example program:

program ctitst
implicit none
integer, parameter :: N=4
integer :: i
integer,parameter :: sqr(*)=[(i*i,i=1,N)]
print *,sqr
end program ctitst

FTN95 rejects the declaration/initialisation of sqr():

ERROR S:\sieve\ctitst.F90 5:  An assumed size array (bound of *) is not permitted in this context

Thank you.

12 Dec 2025 3:53 #32549

mecej4

Thank you for the feedback. I have added this to the list.

18 Dec 2025 11:47 #32562

This feature has been added to FTN95 for the next release.

Please login to reply.