Add identifier binding with 'let' #12

Open
opened 2021-02-09 19:22:47 +00:00 by glen · 1 comment
Owner

Do we need "let" that does not allow forward reference and "def" that does? E.g. so you don't have to define functions before you use them? If so, what do we do about:

let a b+2
def b a+2

???

Do we need "let" that does not allow forward reference and "def" that does? E.g. so you don't have to define functions before you use them? If so, what do we do about: ``` let a b+2 def b a+2 ``` ???
glen added the
enhancement
label 2021-02-12 00:21:18 +00:00
glen added a new dependency 2021-02-18 04:37:58 +00:00
Author
Owner

Or a perhaps more serious case:

<<< fun 2
let a fun 1
define fun n-> a+n

With let a 3 this should totally work and display 5.
But as it stands it should not work. How do we detect the difference and what sort of error should it be?

Or a perhaps more serious case: <<< fun 2 let a fun 1 define fun n-> a+n With `let a 3` this should totally work and display 5. But as it stands it should not work. How do we detect the difference and what sort of error should it be?
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: glen/fostr#12
No description provided.