fubark / cyber

Fast and concurrent scripting.
https://cyberscript.dev
MIT License
1.16k stars 38 forks source link

I can't append list to list #64

Closed hiro1729 closed 11 months ago

hiro1729 commented 11 months ago
var g = [[2], [3]]
g.append [1]
print g
panic: Unsupported index operation on type `0`.

main:2:10 main:
g.append [1]
         ^
fubark commented 11 months ago

You should use parentheses to invoke functions. But I do agree the error message is wrong, the latest commit seems to have a better one now:

panic: `func $index(any, int) any` can not be found in `none`.

/Users/fubar/dev/cyber/foo.cy:12:10 main:
g.append [1]
         ^
hiro1729 commented 11 months ago

Thank you!!! I successed!!