erg icon indicating copy to clipboard operation
erg copied to clipboard

do! is not defined

Open markjreed opened this issue 3 years ago • 2 comments

Code from the README:

2.times! do!:
    print! "hello, ", end: ""

Result:

1│ 2.times! do!:
            ^^^
NameError: do! is not defined

erg v0.2.2 installed on macOS 12.5 via rustup-installed cargo 1.63.0

markjreed avatar Aug 15 '22 00:08 markjreed

This is a feature that has not yet been implemented. Since do: is just a syntax sugar for () ->, please use that for a while.

mtshiba avatar Aug 16 '22 16:08 mtshiba

But with () ->, I seem to get a SyntaxError this time. I will fix it.

mtshiba avatar Aug 16 '22 16:08 mtshiba

Fixed in https://github.com/erg-lang/erg/commit/f847029e1658adb8da0d682d79bad10e3a95bbef.

mtshiba avatar Aug 29 '22 13:08 mtshiba