all repos — mn @ 2e36b444705603bda077fce3b5af84f7153bbb1a

A truly minimal concatenative programming language.

mnpkg/baseutils.nim

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
import 
  os

proc reverse*[T](xs: openarray[T]): seq[T] =
  result = newSeq[T](xs.len)
  for i, x in xs:
    result[result.len-i-1] = x 

proc parentDirEx*(s: string): string =
  return s.parentDir