Add syntax sugar for definitions #2

Closed
opened 2018-03-11 07:38:02 +00:00 by DanilaFe · 1 comment
Owner

Old Abacus had the := operator, which allowed the user to create a variable that depended on other variables. This is possible in the new libabacus, however, it is more verbose. In old Abacus:

a = 1
b = 1
c := a+b

In the new abacus, this would be:

a = 1
b = 1
fun c(): num { a+b }

This is more verbose than I'd like. perhaps, add a syntax sugar for generating similar functions?

Old Abacus had the `:=` operator, which allowed the user to create a variable that depended on other variables. This is possible in the new libabacus, however, it is more verbose. In old Abacus: ``` a = 1 b = 1 c := a+b ``` In the new abacus, this would be: ``` a = 1 b = 1 fun c(): num { a+b } ``` This is more verbose than I'd like. perhaps, add a syntax sugar for generating similar functions?
DanilaFe added the enhancement label 2018-03-11 07:42:15 +00:00
Author
Owner

There is now sugar for this:

let c: num be a+b
There is now sugar for this: ``` let c: num be a+b ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Experiments/libabacus#2