emojicode / emojicode

😀😜🔂 World’s only programming language that’s bursting with emojis

Home Page:https://emojicode.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Universal Literals And Expectation Operator 📣

thbwd opened this issue · comments

commented

⭐️ Proposed change

List and dictionary literals will be able to work with any type that implements a special constructor in the next beta of 1.0. It has been a longstanding goal to update the literal syntax.

The propose syntax is:

🍿 1 2 3 🍆
🍿 🔤key🔤 ➡️ 1 🔤another🔤 ➡️  2  🔤third🔤 ➡️  3 🍆

The type that will be instantiated from the literal is determined using type inference.

📣 will be introduced as the expectation operator that allows to specify the type that shall be created from a literal. This will work for number literals (📣23 💧) as well as list and dictionary literals. E.g. 📣 🍿 1 2 3 🍆 🥙 where 🥙 can be created from a list literal.