summary refs log tree commit diff stats
path: root/compiler/lookups.nim
Commit message (Expand)AuthorAgeFilesLines
...
* made compiler more robust for idetools supportAraq2012-07-301-4/+9
* better error handling for better idetools supportAraq2012-07-291-9/+22
* improvements for idetools; system.compiles improvedAraq2012-07-291-1/+6
* next steps for closure consistency; fixes #176Araq2012-07-251-1/+1
* bugfix: UFCS for templates (ttempl3.nim enhanced)Araq2012-05-271-10/+11
* genSym support for hygienic macros and templates.Zahary Karadjov2012-03-261-1/+6
* allowing definitions of procs and templates to be overridden in local scopesZahary Karadjov2012-03-141-2/+9
* year 2012 for most copyright headersAraq2012-01-021-1/+1
* bugfix: preliminary symbol declaration in first pass of genericsAraq2011-12-301-1/+4
* bugfix: the code gen can now handle alias TLock = TSysLock; this fixes thread...Araq2011-12-231-1/+1
* support for C++ code generation; importcpp and importobjc pragmasAraq2011-08-071-2/+2
* bugfix: forwarding of generic procs now worksAraq2011-07-301-1/+1
* preparations for 0.8.12Araq2011-07-101-4/+4
* intsets are now a proper module and part of the stdlibAraq2011-06-141-8/+8
* cleaned up the tests; fixes #30; fixes #26Araq2011-05-011-30/+44
* got rid of some arcane module namesAraq2011-04-211-1/+1
* big repo cleanupAraq2011-04-121-0/+234
000DD; font-weight: bold } /* Literal.Number.Integer.Long */
discard """
  file: "tlenopenarray.nim"
  output: '''1
0
Whopie
12
1.7'''
"""

echo len([1_000_000]) #OUT 1

type
  TArray = array[0..3, int]
  TVector = distinct array[0..3, int]
proc `[]`(v: TVector; idx: int): int = TArray(v)[idx]
var v: TVector
echo v[2]

# bug #569

import deques

type
  TWidget = object
    names: Deque[string]

var w = TWidget(names: initDeque[string]())

addLast(w.names, "Whopie")

for n in w.names: echo(n)

# bug #681

type TSomeRange = object
  hour: range[0..23]

var value: string
var val12 = TSomeRange(hour: 12)

value = $(if val12.hour > 12: val12.hour - 12 else: val12.hour)
echo value

# bug #1334

var ys = @[4.1, 5.6, 7.2, 1.7, 9.3, 4.4, 3.2]
#var x = int(ys.high / 2) #echo ys[x] # Works
echo ys[int(ys.high / 2)] # Doesn't work