mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 04:57:49 +00:00
28 lines
494 B
Nim
28 lines
494 B
Nim
discard """
|
|
output: '''a
|
|
long
|
|
list
|
|
of
|
|
words'''
|
|
cmd: r"nim c --hints:on $options -d:release $file"
|
|
ccodecheck: "! @'genericSeqAssign'"
|
|
"""
|
|
|
|
|
|
# bug #4354
|
|
import tables
|
|
import sets
|
|
import strutils
|
|
|
|
#const FRUITS = ["banana", "apple", "grapes"]
|
|
#let FRUITS = ["banana", "apple", "grapes"].toSet
|
|
const FRUITS = {"banana":0, "apple":0, "grapes":0}.toTable
|
|
|
|
proc main() =
|
|
let L = "a long list of words".split()
|
|
for word in L:
|
|
if word notin FRUITS:
|
|
echo(word)
|
|
|
|
main()
|