mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 04:02:41 +00:00
Merge branch 'devel' into bigbreak
Conflicts: compiler/ast.nim compiler/nimfix/prettybase.nim compiler/pragmas.nim compiler/sempass2.nim doc/manual.txt koch.nim lib/pure/concurrency/threadpool.nim web/news.txt
This commit is contained in:
@@ -9,6 +9,26 @@ first implementation to play with a language feature before a nicer syntax
|
||||
to access the feature becomes available.
|
||||
|
||||
|
||||
deprecated pragma
|
||||
-----------------
|
||||
|
||||
The deprecated pragma is used to mark a symbol as deprecated:
|
||||
|
||||
.. code-block:: nimrod
|
||||
proc p() {.deprecated.}
|
||||
var x {.deprecated.}: char
|
||||
|
||||
It can also be used as a statement. Then it takes a list of *renamings*. The
|
||||
upcoming ``nimfix`` tool can automatically update the code and perform these
|
||||
renamings:
|
||||
|
||||
.. code-block:: nimrod
|
||||
type
|
||||
File = object
|
||||
Stream = ref object
|
||||
{.deprecated: [TFile: File, PStream: Stream].}
|
||||
|
||||
|
||||
noSideEffect pragma
|
||||
-------------------
|
||||
The ``noSideEffect`` pragma is used to mark a proc/iterator to have no side
|
||||
|
||||
@@ -16,6 +16,11 @@ customize this style sheet.
|
||||
Andreas Rumpf
|
||||
*/
|
||||
|
||||
body {
|
||||
color: black;
|
||||
background: white;
|
||||
}
|
||||
|
||||
/* used to remove borders from tables and images */
|
||||
.borderless, table.borderless td, table.borderless th {
|
||||
border: 0 }
|
||||
|
||||
6
koch.nim
6
koch.nim
@@ -85,9 +85,11 @@ proc csource(args: string) =
|
||||
exec("$4 cc $1 -r $3 --var:version=$2 csource compiler/nim.ini $1" %
|
||||
[args, NimVersion, compileNimInst, findNim()])
|
||||
|
||||
proc zip(args: string) =
|
||||
exec("$3 cc -r $2 --var:version=$1 zip compiler/nim.ini" %
|
||||
proc zip(args: string) =
|
||||
exec("$3 cc -r $2 --var:version=$1 scripts compiler/nim.ini" %
|
||||
[NimVersion, compileNimInst, findNim()])
|
||||
exec("$# --var:version=$# zip compiler/nim.ini" %
|
||||
["tools/niminst/niminst".exe, NimVersion])
|
||||
|
||||
proc buildTool(toolname, args: string) =
|
||||
exec("$# cc $# $#" % [findNim(), args, toolname])
|
||||
|
||||
@@ -56,6 +56,8 @@ proc addFile*(z: var TZipArchive, dest, src: string) =
|
||||
## Adds the file `src` to the archive `z` with the name `dest`. `dest`
|
||||
## may contain a path that will be created.
|
||||
assert(z.mode != fmRead)
|
||||
if not fileExists(src):
|
||||
raise newException(EIO, "File '" & src & "' does not exist")
|
||||
var zipsrc = zip_source_file(z.w, src, 0, -1)
|
||||
if zipsrc == nil:
|
||||
#echo("Dest: " & dest)
|
||||
|
||||
@@ -18,15 +18,24 @@ when not defined(windows):
|
||||
|
||||
when defined(linux):
|
||||
import linux
|
||||
|
||||
when defined(freebsd) or defined(macosx):
|
||||
{.emit:"#include <sys/types.h>".}
|
||||
|
||||
when defined(openbsd) or defined(netbsd):
|
||||
{.emit:"#include <sys/param.h>".}
|
||||
|
||||
when defined(macosx) or defined(bsd):
|
||||
# we HAVE to emit param.h before sysctl.h so we cannot use .header here
|
||||
# either. The amount of archaic bullshit in Poonix based OSes is just insane.
|
||||
{.emit:"#include <sys/sysctl.h>".}
|
||||
const
|
||||
CTL_HW = 6
|
||||
HW_AVAILCPU = 25
|
||||
HW_NCPU = 3
|
||||
proc sysctl(x: ptr array[0..3, cint], y: cint, z: pointer,
|
||||
a: var csize, b: pointer, c: int): cint {.
|
||||
importc: "sysctl", header: "<sys/sysctl.h>".}
|
||||
importc: "sysctl", nodecl.}
|
||||
|
||||
proc countProcessors*(): int {.rtl, extern: "ncpi$1".} =
|
||||
## returns the numer of the processors/cores the machine has.
|
||||
|
||||
@@ -503,9 +503,9 @@ when haveZipLib:
|
||||
else: n = c.outdir / n
|
||||
var z: TZipArchive
|
||||
if open(z, n, fmWrite):
|
||||
addFile(z, proj / buildBatFile32, buildBatFile32)
|
||||
addFile(z, proj / buildBatFile64, buildBatFile64)
|
||||
addFile(z, proj / buildShFile, buildShFile)
|
||||
addFile(z, proj / buildBatFile32, "build" / buildBatFile32)
|
||||
addFile(z, proj / buildBatFile64, "build" / buildBatFile64)
|
||||
addFile(z, proj / buildShFile, "build" / buildShFile)
|
||||
addFile(z, proj / installShFile, installShFile)
|
||||
addFile(z, proj / deinstallShFile, deinstallShFile)
|
||||
for f in walkFiles(c.libpath / "lib/*.h"):
|
||||
@@ -513,7 +513,7 @@ when haveZipLib:
|
||||
for osA in 1..c.oses.len:
|
||||
for cpuA in 1..c.cpus.len:
|
||||
var dir = buildDir(osA, cpuA)
|
||||
for k, f in walkDir(dir):
|
||||
for k, f in walkDir("build" / dir):
|
||||
if k == pcFile: addFile(z, proj / dir / extractFilename(f), f)
|
||||
|
||||
for cat in items({fcConfig..fcOther, fcUnix}):
|
||||
|
||||
30
web/news.txt
30
web/news.txt
@@ -63,11 +63,6 @@ News
|
||||
The modules that use ``importCpp`` or ``importObjc`` are compiled to C++
|
||||
or Objective C code, any other module is compiled to C code. This
|
||||
improves interoperability.
|
||||
|
||||
|
||||
Language Additions
|
||||
------------------
|
||||
|
||||
- There is a new ``parallel`` statement for safe fork&join parallel computing.
|
||||
- ``guard`` and ``lock`` pragmas have been implemented to support safer
|
||||
concurrent programming.
|
||||
@@ -81,16 +76,23 @@ News
|
||||
system.writeFile
|
||||
|
||||
|
||||
Library Additions
|
||||
-----------------
|
||||
Language Additions
|
||||
------------------
|
||||
|
||||
- Added module ``cpuinfo``.
|
||||
- Added module ``threadpool``.
|
||||
- ``sequtils.distnct`` has been renamed to ``sequtils.deduplicate``.
|
||||
- Added ``algorithm.reversed``
|
||||
- Added ``uri.combine`` and ``uri.parseUri``.
|
||||
- Some sockets procedures now support a ``SafeDisconn`` flag which causes
|
||||
them to handle disconnection errors and not raise them.
|
||||
- This version introduces the new ``deprecated`` pragma statement that is used
|
||||
to handle the upcoming massive amount of symbol renames.
|
||||
|
||||
|
||||
Library Additions
|
||||
-----------------
|
||||
|
||||
- Added module ``cpuinfo``.
|
||||
- Added module ``threadpool``.
|
||||
- ``sequtils.distnct`` has been renamed to ``sequtils.deduplicate``.
|
||||
- Added ``algorithm.reversed``
|
||||
- Added ``uri.combine`` and ``uri.parseUri``.
|
||||
- Some sockets procedures now support a ``SafeDisconn`` flag which causes
|
||||
them to handle disconnection errors and not raise them.
|
||||
|
||||
|
||||
2014-04-21 Version 0.9.4 released
|
||||
|
||||
Reference in New Issue
Block a user