[Thread Prev][Thread Next][Index]

Re: [ferret_users] high-to-low range for REPEAT over pseudo-variable



Marco and Ansley,

On Fri, Sep 4, 2020 at 5:29 PM Marco van Hulten <Marco.Hulten@xxxxxx> wrote:
That was the part that I did expect.  REPEAT/RANGE does the thing that
Fortran, Julia &c. also do (in FOR loops), but as soon we use
pseudo-variables it becomes less intuitive in my mind.

Maybe it would be nice if a new syntax is introduced for one of the two behaviors without removing the existing syntax.

Off the top of my head (and hence I don't think this is optimal),

repeat/i=(10, 1, -1)
  --> i = 10, 9, 8, . . . 
repeat/range=(10,1,-1)/name=m
  --> m = 10, 9, 8, . . .

whereas

repeat/i=10:1  --> i = 1, 2, 3, . . .
repeat/range=10:1  --> empty range.

Eventually the users would move away from the old syntax and the inconsistency would become less of the problem.

Regards,
Ryo


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement