-
Notifications
You must be signed in to change notification settings - Fork 106
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
Named import sugar #420
Named import sugar #420
Conversation
Oh, we don’t have that yet? I fully agree and I think we always wanted that. |
let L = (import "serverLang.as"); | ||
let Model = (import "serverModel.as"); | ||
let Result = (import "../../result.as"); | ||
import P = "../../prelude.as"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn’t this be
import P "../../prelude.as"
now, i.e. without the =
, just like for actor
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, judging from the parser we can actually write
let a = actor { … } // 1
actor a { … } // 2
actor a = { … } // 3
I did not know that :-/
Do we need both 2 and 3? (At least I got used to 2 and am surprised that 3 works as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not happy with having both. The only place where you occasionally need the third form is with class, since it's not syntactically possible to name self otherwise.
My functional programmer mind would prefer removing (2) and sticking to (3), but I suppose curly braces folks expect (2)...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our users in stdlib/
wildly mix 2 and 3 for class
, 2 for actor
, don't have named new
, don’t have object
, and wildly mix 2 and 3 for func
.
Just to avoid us spending too much time on such discussions I will refrain from arguing for either 2 or 3 (but express a preference to having just one of them) :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, but independent from this PR, I presume.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, absolutely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with this.
## Changelog for motoko-base: Branch: next-moc Commits: [dfinity/motoko-base@fac5e2c5...17535324](dfinity/motoko-base@fac5e2c...1753532) * [`c2b221ae`](dfinity/motoko-base@c2b221a) Add Examples for class methods in Buffer ([dfinity/motoko-base#420](https://togithub.com/dfinity/motoko-base/issues/420))
## Changelog for motoko-base: Branch: next-moc Commits: [dfinity/motoko-base@fac5e2c5...17535324](dfinity/motoko-base@fac5e2c...1753532) * [`c2b221ae`](dfinity/motoko-base@c2b221a) Add Examples for class methods in Buffer ([dfinity/motoko-base#420](https://togithub.com/dfinity/motoko-base/issues/420))
## Changelog for candid: Branch: master Commits: [dfinity/candid@f7166f47...9301221a](dfinity/candid@f7166f4...9301221) * [`51c00478`](dfinity/candid@51c0047) spec: support composite query ([dfinity/candid#420](https://togithub.com/dfinity/candid/issues/420)) * [`74869398`](dfinity/candid@7486939) fix recursion test ([dfinity/candid#425](https://togithub.com/dfinity/candid/issues/425)) * [`eb31f888`](dfinity/candid@eb31f88) Use Arc<Type> with `arc_type` feature ([dfinity/candid#407](https://togithub.com/dfinity/candid/issues/407)) * [`b9d6cbff`](dfinity/candid@b9d6cbf) support custom candid path for export_service ([dfinity/candid#421](https://togithub.com/dfinity/candid/issues/421)) * [`fa29c70d`](dfinity/candid@fa29c70) Add config options for Rust binding ([dfinity/candid#422](https://togithub.com/dfinity/candid/issues/422)) * [`f31396d8`](dfinity/candid@f31396d) Bump webpack from 5.24.4 to 5.76.0 in /tools/ui ([dfinity/candid#413](https://togithub.com/dfinity/candid/issues/413)) * [`9301221a`](dfinity/candid@9301221) release ([dfinity/candid#430](https://togithub.com/dfinity/candid/issues/430))
## Changelog for candid: Branch: master Commits: [dfinity/candid@f7166f47...9301221a](dfinity/candid@f7166f4...9301221) * [`51c00478`](dfinity/candid@51c0047) spec: support composite query ([dfinity/candid#420](https://togithub.com/dfinity/candid/issues/420)) * [`74869398`](dfinity/candid@7486939) fix recursion test ([dfinity/candid#425](https://togithub.com/dfinity/candid/issues/425)) * [`eb31f888`](dfinity/candid@eb31f88) Use Arc<Type> with `arc_type` feature ([dfinity/candid#407](https://togithub.com/dfinity/candid/issues/407)) * [`b9d6cbff`](dfinity/candid@b9d6cbf) support custom candid path for export_service ([dfinity/candid#421](https://togithub.com/dfinity/candid/issues/421)) * [`fa29c70d`](dfinity/candid@fa29c70) Add config options for Rust binding ([dfinity/candid#422](https://togithub.com/dfinity/candid/issues/422)) * [`f31396d8`](dfinity/candid@f31396d) Bump webpack from 5.24.4 to 5.76.0 in /tools/ui ([dfinity/candid#413](https://togithub.com/dfinity/candid/issues/413)) * [`9301221a`](dfinity/candid@9301221) release ([dfinity/candid#430](https://togithub.com/dfinity/candid/issues/430))
## Changelog for musl-wasi: Branch: main Commits: [WebAssembly/wasi-libc@aecd368c...bd950eb1](WebAssembly/wasi-libc@aecd368...bd950eb) * [`5862047a`](WebAssembly/wasi-libc@5862047) Adjust Makefile for LLVM trunk (17) as of 2023-06-18 ([WebAssembly/wasi-libc#422](https://togithub.com/WebAssembly/wasi-libc/issues/422)) * [`7018e24d`](WebAssembly/wasi-libc@7018e24) Fix a use-after-free bug for detached threads ([WebAssembly/wasi-libc#420](https://togithub.com/WebAssembly/wasi-libc/issues/420)) * [`43e71239`](WebAssembly/wasi-libc@43e7123) Improve `README.md` ([WebAssembly/wasi-libc#425](https://togithub.com/WebAssembly/wasi-libc/issues/425)) * [`bd950eb1`](WebAssembly/wasi-libc@bd950eb) Use -fno-strict-aliasing for emmalloc ([WebAssembly/wasi-libc#424](https://togithub.com/WebAssembly/wasi-libc/issues/424))
## Changelog for musl-wasi: Branch: main Commits: [WebAssembly/wasi-libc@aecd368c...bd950eb1](WebAssembly/wasi-libc@aecd368...bd950eb) * [`5862047a`](WebAssembly/wasi-libc@5862047) Adjust Makefile for LLVM trunk (17) as of 2023-06-18 ([WebAssembly/wasi-libc#422](https://togithub.com/WebAssembly/wasi-libc/issues/422)) * [`7018e24d`](WebAssembly/wasi-libc@7018e24) Fix a use-after-free bug for detached threads ([WebAssembly/wasi-libc#420](https://togithub.com/WebAssembly/wasi-libc/issues/420)) * [`43e71239`](WebAssembly/wasi-libc@43e7123) Improve `README.md` ([WebAssembly/wasi-libc#425](https://togithub.com/WebAssembly/wasi-libc/issues/425)) * [`bd950eb1`](WebAssembly/wasi-libc@bd950eb) Use -fno-strict-aliasing for emmalloc ([WebAssembly/wasi-libc#424](https://togithub.com/WebAssembly/wasi-libc/issues/424))
## Changelog for musl-wasi: Branch: main Commits: [WebAssembly/wasi-libc@aecd368c...bd950eb1](WebAssembly/wasi-libc@aecd368...bd950eb) * [`5862047a`](WebAssembly/wasi-libc@5862047) Adjust Makefile for LLVM trunk (17) as of 2023-06-18 ([WebAssembly/wasi-libc#422](https://togithub.com/WebAssembly/wasi-libc/issues/422)) * [`7018e24d`](WebAssembly/wasi-libc@7018e24) Fix a use-after-free bug for detached threads ([WebAssembly/wasi-libc#420](https://togithub.com/WebAssembly/wasi-libc/issues/420)) * [`43e71239`](WebAssembly/wasi-libc@43e7123) Improve `README.md` ([WebAssembly/wasi-libc#425](https://togithub.com/WebAssembly/wasi-libc/issues/425)) * [`bd950eb1`](WebAssembly/wasi-libc@bd950eb) Use -fno-strict-aliasing for emmalloc ([WebAssembly/wasi-libc#424](https://togithub.com/WebAssembly/wasi-libc/issues/424))
For more natural looks, allow declarations of the form
as sugar for
analogous to other forms.