Values and types
Every value in Asomiya has one of six types. প্ৰকাৰ (prokar) tells you which.
| Type | English letters | Examples |
|---|---|---|
সংখ্যা number | xonkhya | ৪২, 3.14, -৭ |
পাঠ text | path | "নমস্কাৰ" |
সঁচা-মিছা boolean | xosa-misa | সঁচা, মিছা |
খালী empty | khali | খালী |
তালিকা list | talika | [১, ২, ৩] |
ফাংচন function | fangchon | ফাংচন যোগ(ক, খ) { … } |
কোৱা(প্ৰকাৰ(৪২), প্ৰকাৰ("অসম"), প্ৰকাৰ(সঁচা), প্ৰকাৰ(খালী), প্ৰকাৰ([১, ২]))
Output
সংখ্যা পাঠ সঁচা-মিছা খালী তালিকা
kowa(prokar(42), prokar("Oxom"), prokar(xosa), prokar(khali), prokar([1, 2]))
Output
xonkhya path xosa-misa khali talika
Numbers
Write numbers with Assamese digits (২৪) or ASCII digits (24), but don’t mix them in one number. Whole numbers and decimals are the same type.
Text
Text goes inside double quotes. Use \n for a new line, \t for a tab and \" for a quote. See Working with text.
True and false
সঁচা and মিছা (xosa, misa) are the results of comparisons. Conditions in যদি and loops must be one of these: Asomiya has no “truthy” values, so যদি (১) is an error. This catches many mistakes early.
Converting between types
ধৰা লিখা = "৪২"
ধৰা সংখ্যাটো = সংখ্যা(লিখা)
কোৱা(সংখ্যাটো + ১)
কোৱা(পাঠ(১০) + "০")
কোৱা(পূৰ্ণাংক(৩.৯))
Output
৪৩ ১০০ ৩
dhora likha = "42"
dhora xonkhyato = xonkhya(likha)
kowa(xonkhyato + 1)
kowa(path(10) + "0")
kowa(purnanko(3.9))
Output
43 100 3
সংখ্যা() gives খালী if the text isn’t a number, so you can check user input safely.