Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We are making some syntax changes before beta release, this PR migrates core:
!
is replaced byraise
, for example(..) -> T!Error
will become(..) -> T raise Error
,-> T?Error
is replaced by-> T raise?
type!
is replaced by a new keywordsuberror
extern type
have very different semantic in different backends, we decided to deprecate this syntax and use an attribute#external
instead. This gives more flexibility for future adjustment, if some backend demand richer FFI type declaration.mbti
interface. So we decided to deprecate complex default value that depend on previous arguments. This kind of default value can be replaced bylabel? : T
and amatch
onlabel
inside function body, so there is no loss in expressivenesstypealias A = B
is deprecated and replaced bytypealias B as A
, similarly fortraitalias
. This simplifies MoonBit's syntax without loss of expresivenessloop
with multiple parameters is deprecated. Users can alternatively useloop
with a single tuple parameter. MoonBit compiler is capable to optimize away the tuple, so there will be no loss in performance. This change makesmatch
andloop
more consistenttry
can now be omitted when catching error in a simple expression, e.g.f() catch { _ => panic() }
. This syntax is inspired by Zig