Well, if you need gmatch3 then it won't do. But if gmatch1 and gmatch2 are
enough, use C++-like approach and make those a proc which returns a structure
with items and pairs iterators.
type MatchWrap = distinct seq[string]
proc gmatch(src, pat: string): MatchWrap =
l
@mashingan @StasB What if a macro uses, let's say, system date? Or connects to
a database (you can't check whenever it changed until you do connect)? And
still, even a noSideEffect macro is a code generator/transformer, not a textual
substituter so there is no analogy to C.
Regarding the overloading, why not call these `gmatch1`, `gmatch2` and
`gmatch3` and call it a day?
You could also unpack your seq using some of the answers proposed here:
[https://stackoverflow.com/questions/31948131/unpack-multiple-variables-from-sequence](https://stackoverflow.com/questions/3
I'm working on a Nim port of the Lua pattern matching code. Lua patterns are a
bit like regular expressions, but simpler. The implementation is pretty small,
however, compared to regular expressions, and the port is pure Nim and does not
require any shared libraries like PCRE for the re and nre
If the macro hasn't changed and the module where the macro is used hasn't
changed, then the result of compiling the module remains the same, so what
reason is there to call the macro again, except for side-effects?
Possible cause, Windows Defender, especially that "Real-time protection"
setting.
It's sandboxing any executable during first run.
I don't know how clever a compiler you want, but as far I understand, macro
always evaluated during compile time.
If not, you get the macro what do you usually works with C, just a simple
textual substitution. And that's not what you want, really.
Thanks! Actually, I already compiled devel but when running nim --version the
output was 0.17.3 so I did not think nimble would install godot as the output
previously was nim v0.18+ required. But running nimble install godot with
0.17.3 works.
Hey Jim,
I'm not sure how you've ended up here, but this is a forum for the Nim
programming language. Not for JavaScript. You should consider asking your
question on StackOverflow or another forum dedicated to HTML/JS.
You could also use [choosenim](https://github.com/dom96/choosenim)
0.18 hasn't been released yet. Godot-nim appears to depend on `devel` (a.k.a
v0.17.3 a.k.a the development version).
Easiest way to get `devel` is via
[choosenim](https://github.com/dom96/choosenim)
>From the
>[manual](https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-importcpp-pragma)
> :
proc cppMethod(this: CppObj, a, b, c: cint) {.importcpp: "#.CppMethod(@)".}
Produces:
x->CppMethod(1, 2, 3)
As a special rule to keep backwards compat
Hi, I'm trying to install godot-nim, but this package requires nim version
0.18. I can't find this tag in the official nim repo. Can someone point me to
latest "stable" 0.18 branch?
The reason for this is & has a lower precedence than |, therefore it parses as:
lc["Number: " & ($y | (y <- 1..10)), string]
OK,
Im considering that [jsffi](https://nim-lang.org/docs/jsffi.html#jsnew,auto) is
good way.
var scene = jsnew(Scene())
var geometry = jsnew(BoxGeometry( 1, 1, 1,0,0,0 ))
will transpiled as
var scene_69011 = (new THREE.Scene());
var geometry_69079 = (new
Please,
I can this javascript code
var scene = new THREE.Scene();
using in nim js. Defing type
type
THREE* = ref THREEObj
THREEObj {.importc.} = object
Scene* {.importc.}: proc(): void
{.push importcpp.}
# v
Thank you for making this forum available.
I have an html document that contains a large canvas containing a few
rectangle. The javascript is inside the html body tags so that the stroke style
rectangles will be placed on top of the background (a staff of lines) and show
the staff through the r
Well the "compilation cache" / "symbol files" / "incremental recompilation"
feature is in the works and indeed it treats `slurp` like `include` and so will
notice if the dependency changed or not. But this feature is not yet ready for
anything. Regardless of it, macros are always re-evaluated si
Why does it need to be done for pure macros if the code hasn't changed?
I ran into a similar problem on one of my computers (running Win7), but only
through the --run option. Does it still take that long if you run the produced
executable manually?
@Araq: As far as I can tell, when a macro has side-effects (e.g. echo), its
invocations get re-evaluated, even if the macro itself and the modules
containing the invocations remain unchanged. Is the compiler smart enough to
only do that with macros that have side-effects? What happens if the mac
This works great
[https://nim-lang.org/install_unix.html](https://nim-lang.org/install_unix.html)
Installation using package managers Arch Linux pacman -S nim Debian / Ubuntu
apt-get install nim
17-18 seconds is too much even for Antivirus, what OS do you use?
@domogled, currently there no officially supported packages of Nim for Debian
or any other Linux distro.
The recommended method to install Nim is
[https://github.com/nim-lang/Nim#compiling](https://github.com/nim-lang/Nim#compiling).
If you have any troubles with Nim package in your Linux distr
Danke, but
git clone https://github.com/nim-lang/nimble.git
cd nimble
nim c src/nimble
/.nimble/pkgs/compiler-#head/compiler/ast.nim(13, 50) Error: cannot open
'std/sha1'
.
I have nimble installed from debian package with nim-lang. I can use module cli
f
> It's a little odd that the compiler bothers to parse the unaltered foo.nim,
> but it looks like it doesn't actually compile anything, because it doesn't
> modify the corresponding .c and .o >files in the cache.
Araq, I think he wants that Nim source files are only compiled when changed,
maybe
Antivir scanning the produced files?
> I guess the lack of reply on the actual RFC means it's not happening, or
> maybe it ran into some kind of roadblock?
Any proposal which cannot deal with macros is hard to accept. There seems to be
an overlap between the people who like cyclic imports and those who use OO
designs with `class`-
I don't understand your questions. Macros get evaluated when required, there is
no "useless" work.
`nimble install nimble` is not the way to install Nimble.
[https://github.com/nim-lang/nimble#installation](https://github.com/nim-lang/nimble#installation)
@cdome: That sounds interesting, but I'm not sure I understand how that helps
with circular type dependencies. Would you mind giving an example?
31 matches
Mail list logo