Replies: 3 comments 7 replies
-
Thought: Expressions should be able to run directly in the REPL. This feels like basic QOL. |
Beta Was this translation helpful? Give feedback.
-
This is exactly what I don't want to happen to Asteroid by supporting expressions as statements,
Notice that the function definition is legal but makes no sense... We have to make sure that the user understands that expression access at the statement level is purely a REPL supported thing...or is the above a strong enough argument not to support expressions at the statement level at all? |
Beta Was this translation helpful? Give feedback.
-
Actually, both Rust and R support expressions at the statement level with an interesting semantics: if the expression is the last statement of a function then the value computed by the expression becomes the return value of the function. Applying this semantics to the above Python program implies the following behavior,
That might be an interesting extension to the Asteroid language. |
Beta Was this translation helpful? Give feedback.
-
For the next release of asteroid we would like just two things to work for our REPL.
I'll try to use this discussion to bring up any major questions I have while developing 😎
Beta Was this translation helpful? Give feedback.
All reactions