Jump to content

AnyLang Programming Language Comparison/Introduction/Variables

From Wikibooks, open books for an open world

Core concepts

[edit | edit source]
  • declaration
  • assignment
    • assignment by reference
    • assignment by value
  • typing (type system)
    • type conversion (explicit)
    • type conversion (implicit)


Common types

[edit | edit source]

String

[edit | edit source]
  - label:   string
    a_abbrv: anylang/string (ss)
    a_aka:   string varchar

Array

[edit | edit source]
  - label:   array
    a_abbrv: anylang/array (aa)
    a_aka:   list simple_sequence

Core concepts

[edit | edit source]
  • core_arrayop.append ;; (aka array push) insert a single-element at the highest index. array treated as a single nested element
  • core_arrayop.prepend ;; (aka array unshift) insert element at the lowest index
  • core_arrayop.unappend ;; (aka array pop) remove and return element at the highest index
  • core_arrayop.unprepend ;; (aka array shift) remove and return element at the lowest index

Associative array

[edit | edit source]

An associative array is a mapping of keys to values. This is also known as a Hash, Hashtable and Dictionary. [1][2]

References

[edit | edit source]
  1. "Associative_array". Retrieved 2010-05-01. http://en.wikipedia.org/wiki/Associative_array
  2. From "Dive into Python" Note A dictionary in Python is like a hash in Perl. In Perl, variables which store hashes always start with a % character; in Python, variables can be named anything, and Python keeps track of the datatype internally. Note A dictionary in Python is like an instance of the Hashtable class in Java. Note A dictionary in Python is like an instance of the Scripting.Dictionary object in Visual Basic.