airportyh / fun-lang

Fun is programming language that supports both the functional and the imperative styles of programming. It distinguishes these two styles by allowing the programmer to choose between them explicitly: you can either write funs - which are pure, or procs - which are impure.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

var dict = { [object Object]: "George", [object Object]: 12 }; dict.fun example

kitaboon opened this issue · comments

Hello !
I watched all videos about nearley they are just amazing !
I came here to see the fun-lang, but when i run the dictionnary example, there is a problem :

var dict = { [object Object]: "George", [object Object]: 12 };

Here is the fun code : (file: mytest.fun)

proc main() [
    dict = { name: "George", age: 12 }
    dict["name"] = "Barnes"
    print(dict["name"])
]

Command i run

node scripts/run.js mytest.fun

Thank you for the comment and the bug report! Fixed in master. It was due to the key of a dictionary entry being change (at some point) from a string to a token. Haven't covered tokens in the videos yet. Plan to.

👍 Thank you very much !
Your videos are awesome, I was searching simple and good tutorials for months when, one day, i found your channel: best channel for the subject