|
Oktatás * Programozás 1 * Szkriptnyelvek Teaching * Programming 1 (BI) Félévek Linkek * kalendárium |
Nim2 /
const exampleWe've already seen The value of a Consider the following example: proc get_string(): string = result = "" echo "Generating the string..." result.add("hello ") result.add("nim") const TEXT = get_string() echo TEXT Let's compile and execute it: $ nim c --hints:off --warnings:off main.nim Generating the string... $ ./main hello nim Notice that the text "Generating the string…" only appears during the compilation. The compiler calls const TEXT = "hello nim" And this code is compiled further. Keep in my mind that if (for instance) you create a huge |
![]() Blogjaim, hobbi projektjeim * The Ubuntu Incident [ edit ] |