Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2025/26/2
* archívum


Linkek

* kalendárium
   - munkaszüneti napok '20
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C++
* C#
* Clojure
* D lang.
* Java
* Nim
* Nim2
* Scala


[ edit | logout ]
[ sandbox | passwd ]

Case insensitive identifier names

Identifiers (variable/procedure names) are case insensitive in Nim, with the exception of the first character. Identifiers start with a lowercase letter, while types' name start with an uppercase letter. But after the first character, identifiers are case insensitive, and the underscore ('_') charcater can be either used or omitted.

let my_name = "Laci"

echo my_name  # Laci

echo myName   # Laci

echo myname   # Laci

echo m_y_n_a_m_e  # Laci

#echo MyName  # error

Why? Let's say there is a library that uses the camelCase style. However, in your programs you prefer the snake_case style. You can continue using the snake_case style, the compiler will find what you refer to.

import third_party_pkg  # it has an isPalindrome() function

let name = "anna"

echo name.is_palindrome()  # works

echo name.isPalindrome()   # also works

What about the first character?

The first character matters.

type
  Dog = object
    name: string

let dog = Dog(name: "Dogmeat")  # here, dog and Dog are two different things

echo dog  # (name: "Dogmeat")
Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2026 April 06, 00:08