English

Miscellaneous Syntax

This is syntax for advanced users that you won't use very often.

Returning nothing (◼️)

Writing ◼️ where the return type goes states explicitly that nothing is returned. It is mostly used in closure types.

Emojicode
🏁 🍇
  🍇 ➡️ ◼️
    😀 🔤Returns nothing🔤❗️
  🍉 ➡️ f
  ⁉️ f❗️
🍉
Output
Returns nothing

Size of a type (⚖️)

⚖️Type returns how many bytes one value of that type takes.

Emojicode
🏁 🍇
  😀 🔡 ⚖️🔢❗️❗️
  😀 🔡 ⚖️💯❗️❗️
  😀 🔡 ⚖️👌❗️❗️
🍉
Output
8
8
1

Deprecation (⚠️)

If you put ⚠️ on a method, a warning is shown wherever that method is used. Its behavior does not change.

Emojicode
🐇 🧓 🍇
  ⚠️🐇❗️ 📠 🍇
    😀 🔤Old method🔤❗️
  🍉
🍉

🏁 🍇
  📠🐇🧓❗️
🍉
Output
Old method

When you compile it, you get the warning ⚠️ warning: 📠 is deprecated.

Inlining (🥯)

If you put 🥯 on a method, you ask the compiler to expand its body where it is called. Its behavior does not change.

Emojicode
🐇 ➰ 🍇
  🥯🐇❗️ ✌️ n 🔢 ➡️ 🔢 🍇
    ↩️ n ✖️ 2
  🍉
🍉

🏁 🍇
  😀 🔡 ✌️🐇➰ 21❗️❗️❗️
🍉
Output
42

Unsafe code (☣️)

Inside ☣️ 🍇 … 🍉 you can write unsafe code, such as code that works with memory directly. It is used inside the standard library, but you won't use it in ordinary programs.

Emojicode
🏁 🍇
  ☣️ 🍇
    😀 🔤Inside unsafe🔤❗️
  🍉
🍉
Output
Inside unsafe

Skipping per-type generic information (🎍🛢)

If you put 🎍🛢 on a generic value type, no runtime information is created for each type argument. It is used inside the standard library's lists and dictionaries.

Emojicode
🎍🛢 🕊 📦🐚T ⚪️🍆 🍇
  🖍🆕 v T
  🆕 🍼 v T 🍇🍉
  ❗️ 📤 ➡️ T 🍇
    ↩️ v
  🍉
🍉

🏁 🍇
  😀 📤 🆕📦🐚🔡🍆 🔤ok🔤❗️❗️❗️
🍉
Output
ok

Removed syntax (🔟)

“Symbol literals” starting with 🔟 existed in older versions of Emojicode and can no longer be used. Writing one causes a compile error. When you want to work with a single character, use a string (🔤).

Example of a compile error
🏁 🍇
  🔟🍎 ➡️ s
🍉
Error
🔣 has been removed.