-
-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Submodule resolution failed #468
Comments
Perhaps a related example in other languages is ES Modules (recently adopted in JavaScript), where some restrictions, such as limiting Also, I don't think it is intuitive to write the variable names of the imported items first as an order of thought. (I understand that this could be mitigated by magic completion and auto import functions by the editor) So, how about having a different syntax for import with the intention that it is not a normal function?
ES Modules Specifications: https://tc39.es/ecma262/#sec-modules |
I think only assignment operators should be able to introduce variables. Because it is simpler. But, in many languages the symbols to import are placed on the right side of the module name (Zig is different), so this may be a resistant syntax. from foo import bar, baz I came up with the idea of adopting the right-assignment syntax introduced in Ruby and other languages. x = 1
# same as
1 => x Erg already uses {sin; cos} = pyimport "math"
pyimport "math" =: {sin; cos}
x = 1
1 =: x
rec = {x = 1; y = 2}
rec =: {x; y} |
Indeed, it seems that Erg is emphasizing syntactic simplicity. On the other hand, everything that can be done with the right-assignment syntax can also be done with the standard Considering these points, while it's worth examining the right-assignment syntax, at present I personally believe that the benefits are few, and it's not a feature worth adding just for the import syntax. Similarly, if we prioritize the language's simplicity, my idea of introducing a different syntax for imports might also be better left unimplemented. Even widely-used JavaScript (ES Modules) has the symbols being imported on the left side, and I haven't heard others complain about that. |
I see. At this time, this is not a high priority issue, so we will discuss this again in the future if we need to. |
#492 may resolve |
Describe the bug?
Suppose we have
bar
module in thefoo
module andfunc
function in thebar
module.Reproducible code
Expected result
passed
Actual result
Only No.1 fails to compile.
Additional context
The signature of the
pyimport
function has so far been defined just as a dependent function, but perhaps it should be a compiler built-in magic function.Erg version
0.6.25
Python version
None
OS
None
The text was updated successfully, but these errors were encountered: