math.nim works with NimScript

This commit is contained in:
Araq 2015-08-21 12:46:30 +02:00
commit c56a1f8266
2 changed files with 10 additions and 7 deletions

View file

@ -25,7 +25,7 @@ include "system/inclrtl"
when defined(Posix) and not defined(haiku): when defined(Posix) and not defined(haiku):
{.passl: "-lm".} {.passl: "-lm".}
when not defined(js): when not defined(js) and not defined(nimscript):
import times import times
const const
@ -152,10 +152,11 @@ proc random*(max: float): float {.benign.}
## number, i.e. a tickcount. This has a 16-bit resolution on windows ## number, i.e. a tickcount. This has a 16-bit resolution on windows
## and a 48-bit resolution on other platforms. ## and a 48-bit resolution on other platforms.
when not defined(nimscript):
proc randomize*() {.benign.} proc randomize*() {.benign.}
## Initializes the random number generator with a "random" ## Initializes the random number generator with a "random"
## number, i.e. a tickcount. Note: Does nothing for the JavaScript target, ## number, i.e. a tickcount. Note: Does nothing for the JavaScript target,
## as JavaScript does not support this. ## as JavaScript does not support this. Nor does it work for NimScript.
proc randomize*(seed: int) {.benign.} proc randomize*(seed: int) {.benign.}
## Initializes the random number generator with a specific seed. ## Initializes the random number generator with a specific seed.
@ -271,6 +272,7 @@ when not defined(JS):
when not defined(vcc): # the above code for vcc uses `discard` instead when not defined(vcc): # the above code for vcc uses `discard` instead
# this is either not Windows or is Windows without vcc # this is either not Windows or is Windows without vcc
when not defined(nimscript):
proc randomize() = proc randomize() =
randomize(cast[int](epochTime())) randomize(cast[int](epochTime()))
proc randomize(seed: int) = proc randomize(seed: int) =

View file

@ -1,6 +1,7 @@
version 0.11.4 version 0.11.4
============== ==============
- make ``os`` and ``math`` work with NimScript
- document special cased varargs[untyped] and varargs[typed] - document special cased varargs[untyped] and varargs[typed]
- The remaining bugs of the lambda lifting pass that is responsible to enable - The remaining bugs of the lambda lifting pass that is responsible to enable