summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--changelog.md4
-rw-r--r--doc/prelude.rst6
-rw-r--r--lib/pure/prelude.nim (renamed from lib/prelude.nim)9
-rw-r--r--tests/stdlib/tprelude.nim14
-rw-r--r--tools/heapdump2dot.nim2
-rw-r--r--tools/heapdumprepl.nim2
-rw-r--r--tools/kochdocs.nim2
7 files changed, 28 insertions, 11 deletions
diff --git a/changelog.md b/changelog.md
index 3f8ee3c3d..7b62ce236 100644
--- a/changelog.md
+++ b/changelog.md
@@ -17,6 +17,8 @@
   `typetraits.nim` module.
 
 - `prelude` now works with the JavaScript target.
+  Added `sequtils` import to `prelude`.
+  `prelude` can now be used via `include std/prelude`, but `include prelude` still works.
 
 - Added `almostEqual` in `math` for comparing two float values using a machine epsilon.
 
@@ -94,8 +96,6 @@
   shallow copying; `lists.add` concatenates two lists - an O(1) variation that consumes
   its argument, `addMoved`, is also supplied.
 
-- Added `sequtils` import to `prelude`.
-
 - Added `euclDiv` and `euclMod` to `math`.
 - Added `httpcore.is1xx` and missing HTTP codes.
 - Added `jsconsole.jsAssert` for JavaScript target.
diff --git a/doc/prelude.rst b/doc/prelude.rst
index 47fa70b70..737e0f34e 100644
--- a/doc/prelude.rst
+++ b/doc/prelude.rst
@@ -4,12 +4,12 @@ Prelude
 This is an include file that simply imports common modules for your convenience:
 
 .. code-block:: nim
-  include prelude
+  include std/prelude
 
 Same as:
 
 .. code-block:: nim
-  import os, strutils, times, parseutils, parseopt, hashes, tables, sets
+  import std/[os, strutils, times, parseutils, hashes, tables, sets, sequtils, parseopt]
 
 
 Examples
@@ -18,7 +18,7 @@ Examples
 Get the basic most common imports ready to start coding using ``prelude``:
 
 .. code-block:: nim
-  include prelude
+  include std/prelude
 
   echo now()
   echo getCurrentDir()
diff --git a/lib/prelude.nim b/lib/pure/prelude.nim
index e8f21fc99..5da608961 100644
--- a/lib/prelude.nim
+++ b/lib/pure/prelude.nim
@@ -11,11 +11,14 @@
 ## convenience:
 ##
 ## .. code-block:: nim
-##   include prelude
+##   include std/prelude
 ##
 ## Same as:
 ##
 ## .. code-block:: nim
-##   import os, strutils, times, parseutils, hashes, tables, sets, sequtils, parseopt
+##   import std/[os, strutils, times, parseutils, hashes, tables, sets, sequtils, parseopt]
+
+# xxx deduplicate with prelude.rst
+
+import std/[os, strutils, times, parseutils, hashes, tables, sets, sequtils, parseopt]
 
-import os, strutils, times, parseutils, hashes, tables, sets, sequtils, parseopt
diff --git a/tests/stdlib/tprelude.nim b/tests/stdlib/tprelude.nim
new file mode 100644
index 000000000..a60bcf70a
--- /dev/null
+++ b/tests/stdlib/tprelude.nim
@@ -0,0 +1,14 @@
+discard """
+  targets: "c js"
+  matrix: "; -d:nimTestTpreludeCase1"
+"""
+
+when defined nimTestTpreludeCase1:
+  include std/prelude
+else:
+  include prelude
+
+template main() =
+  doAssert toSeq(1..3) == @[1,2,3]
+static: main()
+main()
diff --git a/tools/heapdump2dot.nim b/tools/heapdump2dot.nim
index 4cee6d674..6704cdfb0 100644
--- a/tools/heapdump2dot.nim
+++ b/tools/heapdump2dot.nim
@@ -1,5 +1,5 @@
 
-include prelude
+include std/prelude
 
 proc main(input, output: string) =
   type NodeKind = enum
diff --git a/tools/heapdumprepl.nim b/tools/heapdumprepl.nim
index dbaef2f2c..62454165d 100644
--- a/tools/heapdumprepl.nim
+++ b/tools/heapdumprepl.nim
@@ -1,5 +1,5 @@
 
-include prelude
+include std/prelude
 import intsets
 
 type
diff --git a/tools/kochdocs.nim b/tools/kochdocs.nim
index 992725a2e..ca0e07ccc 100644
--- a/tools/kochdocs.nim
+++ b/tools/kochdocs.nim
@@ -143,7 +143,7 @@ lib/posix/termios.nim
 
   # some of these are include files so shouldn't be docgen'd
   ignoredModules = """
-lib/prelude.nim
+lib/pure/prelude.nim
 lib/pure/future.nim
 lib/pure/collections/hashcommon.nim
 lib/pure/collections/tableimpl.nim