@@ -1740,6 +1740,28 @@ when not defined(nimscript):
17401740when not declared (sysFatal):
17411741 include " system/fatal"
17421742
1743+ proc echo * (x: varargs [typed , `$`]) {.magic : " Echo" , benign , sideEffect .}
1744+ # # Writes and flushes the parameters to the standard output.
1745+ # #
1746+ # # Special built-in that takes a variable number of arguments. Each argument
1747+ # # is converted to a string via `$`, so it works for user-defined
1748+ # # types that have an overloaded `$` operator.
1749+ # # It is roughly equivalent to `writeLine(stdout, x); flushFile(stdout)`, but
1750+ # # available for the JavaScript target too.
1751+ # #
1752+ # # Unlike other IO operations this is guaranteed to be thread-safe as
1753+ # # `echo` is very often used for debugging convenience. If you want to use
1754+ # # `echo` inside a `proc without side effects
1755+ # # <manual.html#pragmas-nosideeffect-pragma>`_ you can use `debugEcho
1756+ # # <#debugEcho,varargs[typed,]>`_ instead.
1757+
1758+ proc debugEcho * (x: varargs [typed , `$`]) {.magic : " Echo" , noSideEffect ,
1759+ tags : [], raises : [].}
1760+ # # Same as `echo <#echo,varargs[typed,]>`_, but as a special semantic rule,
1761+ # # `debugEcho` pretends to be free of side effects, so that it can be used
1762+ # # for debugging routines marked as `noSideEffect
1763+ # # <manual.html#pragmas-nosideeffect-pragma>`_.
1764+
17431765type
17441766 PFrame * = ptr TFrame # # Represents a runtime frame of the call stack;
17451767 # # part of the debugger API.
@@ -2002,27 +2024,6 @@ elif hasAlloc:
20022024 inc (i)
20032025 {.pop .}
20042026
2005- proc echo * (x: varargs [typed , `$`]) {.magic : " Echo" , benign , sideEffect .}
2006- # # Writes and flushes the parameters to the standard output.
2007- # #
2008- # # Special built-in that takes a variable number of arguments. Each argument
2009- # # is converted to a string via `$`, so it works for user-defined
2010- # # types that have an overloaded `$` operator.
2011- # # It is roughly equivalent to `writeLine(stdout, x); flushFile(stdout)`, but
2012- # # available for the JavaScript target too.
2013- # #
2014- # # Unlike other IO operations this is guaranteed to be thread-safe as
2015- # # `echo` is very often used for debugging convenience. If you want to use
2016- # # `echo` inside a `proc without side effects
2017- # # <manual.html#pragmas-nosideeffect-pragma>`_ you can use `debugEcho
2018- # # <#debugEcho,varargs[typed,]>`_ instead.
2019-
2020- proc debugEcho * (x: varargs [typed , `$`]) {.magic : " Echo" , noSideEffect ,
2021- tags : [], raises : [].}
2022- # # Same as `echo <#echo,varargs[typed,]>`_, but as a special semantic rule,
2023- # # `debugEcho` pretends to be free of side effects, so that it can be used
2024- # # for debugging routines marked as `noSideEffect
2025- # # <manual.html#pragmas-nosideeffect-pragma>`_.
20262027
20272028when hostOS == " standalone" and defined (nogc):
20282029 proc nimToCStringConv (s: NimString ): cstring {.compilerproc , inline .} =
0 commit comments