Documentation topicsUnicode & Devanagari
Lexical Structure
Control Flow
Functions & Scope
Lists & Built-ins
Reference
MarathiCode v0.2.0
Unicode & Devanagari Support
युनिकोड व देवनागरी
- Source files are read as UTF-8.
- Keywords are written in Devanagari.
- Identifiers may use any character in the Devanagari block (U+0900 to U+097F), including vowel signs,
्(virama), anusvara and nukta. - Numbers may be written with Devanagari digits
०-९. - Strings may contain any Unicode text.
unicode.mr
चल क्षेत्रफळ = १२ * ५
चल शहर = "पुणे 🌆"
छापा(क्षेत्रफळ)
छापा(शहर)Output (आउटपुट)
60 पुणे 🌆
Things to know
- Printed numbers always use ASCII digits:
छापा(१२)prints12. लांबीcounts Unicode code points, not visible letters."मराठी"has 5 code points (म, र, ा, ठ, ी):
length.mr
छापा(लांबी("मराठी"))
छापा("मराठी"[1])Output (आउटपुट)
5 र
Identifiers may not contain the zero-width joiner or non-joiner (U+200D, U+200C), which some keyboards insert in conjoined forms such as र्य. Names are also compared code point by code point, so two names that look identical but are typed with different code point sequences are different names.