niml icon indicating copy to clipboard operation
niml copied to clipboard

Are loops possible inline in niml?

Open stagfoo opened this issue 2 years ago • 2 comments

sorry if this is a silly question im kind new to nim but is it possible to do for loops in niml? im trying to create a select with a for loop to create the options 😓

  return niml:
            select:
                (for i, key in keylist:
                  option:
                    key.name)

stagfoo avatar Aug 19 '22 12:08 stagfoo

No but I can add a special syntax for them. Thing is, I haven't touched this for a long time so I will have to review the code. Otherwise if you want to repeat elements you can nest the niml macro and do a join on the string for now.

jakubDoka avatar Sep 02 '22 10:09 jakubDoka

@jakubDoka no worries

Otherwise if you want to repeat elements you can nest the niml macro and do a join on the string for now.

yeah i ended up doing this which is ok for me usecase

stagfoo avatar Sep 05 '22 11:09 stagfoo