Open rebcabin opened 1 year ago
The current ASR definition is WhileLoop(identifier? name, expr test, stmt* body)
, the first argument is probably a "goto target" to jump to, this is needed if you have multiple nested loops and you are doing "break name" to a specific parent loop. There might be a better way to do it, but for now we use this mechanism. Python doesn't allow breaking to a parent loop, but Fortran does.
ok, that's neat! goto doesn't deserve its bad reputation!
Should the goto target perhaps be a symbol-ref? Or do we want a nice, refined type for goto-targets? or even labels, generically? What about computed gotos, where all the labels are numerical? perhaps the labels ought to be (s/or :numerical ::nat, :symbolic ::symbol-ref)?
On Thu, May 11, 2023 at 7:20 PM Ondřej Čertík @.***> wrote:
The current ASR definition is WhileLoop(identifier? name, expr test, stmt* body), the first argument is probably a "goto target" to jump to, this is needed if you have multiple nested loops and you are doing "break name" to a specific parent loop. There might be a better way to do it, but for now we use this mechanism. Python doesn't allow breaking to a parent loop, but Fortran does.
— Reply to this email directly, view it on GitHub https://github.com/rebcabin/masr/issues/33#issuecomment-1545011038, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABSRR3F2LKM3GTOUHXFWOTXFWM6NANCNFSM6AAAAAAX6ZGHEU . You are receiving this because you authored the thread.Message ID: @.***>
reopening as documentation reminder as requested by @certik
Example from
asr-expr1-dde511e.stdout
has three parameters:but ASDL from
ASDL_2023_APR_06_snapshot.asdl
specifies only two:The first argument in the Example is mysterious. I'll work around it for now.