As far as I know compilers always align your variables unless you specify that
you have other priorities, for example with the [packed
pragma](http://forum.nim-lang.org///nim-lang.org/docs/manual.html#foreign-function-interface-packed-pragma).
For stack variables I don't know it, but I also
Krux02, from what I've read about lockfree (namely Jeff Preshing's blog:
[http://preshing.com](http://forum.nim-lang.org///preshing.com)/ ), one
requirement for atomics in x86 (and other architectures) are aligned variables.
And about the types anything from 1 to four bytes.
Araq,I have
Nim has implicit initialization (
[http://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement](http://forum.nim-lang.org///nim-lang.org/docs/manual.html#statements-and-expressions-var-statement)
) so:
var x : array[10,char]
echo repr x # ['\0', '\0', '\0',
Well, strictly speaking, these are not Posix.
>From the Linux man page:
ATTRIBUTES
For an explanation of the terms used in this section, see
attributes(7).
┌─┬───┬┐
│Interface
Alright, this is what I got working for the posix stuff:
{.passL: "-lutil".}
var SIGWINCH* {.importc, header: "".}: cint
var TIOCGWINSZ* {.importc, header: "".}: cuint
var TIOCSWINSZ* {.importc, header: "".}: cuint
proc openpty (amaster, aslave : ptr int,
win10, nim0.14.2
# use alloc0
var inputs = cast[array[10,int]](alloc0(sizeof(int) * 10))
inputs[0] = 1
inputs[1] = 2
inputs[2] = 3
for i in 0..9:
echo inputs[i]
echo repr inputs
var test = alloc0(10)
zeroMem(test, 10)
echo repr
Every language with complex number support seems to have its own representation
of them.
Python does
1 + 2j
R does
0+1i
Julia does
0.0 + 1.0im
Nim seems to follow the same convention as C++ std::complex with
(0.0, 1.0)
I don't
Can I assume that a var parameter will always be a pointer where I can use
(addr varParm) as copymem destination. It seems to work but I can copy to
tempory local variable and use normal assignment if there is no guarentee it
will always work.
@Araq This sounds like object mapping, in which data from a database is mapped
into a set of objects. That's quite common, and makes working with data much
easier.
> So what do you do: do you tell these teams not to use refs? Or do you tell
> them to go ahead and use refs and garbage collection, and deal with the
> consequences?
To be honest I would fire teams who model business taxonomies with C++ classes
(OMG), keeping all the data in RAM (OMG) and not
Use the `codegenDecl` pragma and to generate any kind of gcc/clang annotation
you need. Compilers are usually good at alignment though.
Thanks for reporting.
I guess you are refering to the chess game?
Lets look at line 70:
if p0 != p1: window(widget.toplevel).title= "invalid move, ignored."
As the compiler told us, there is a symbol window defined in module gtk3 as
well as gdk3. So only two possibilities to try.
I get an error when trying to compile
board.nim(70, 26) Error: ambiguous call; both gtk3.window(obj: expr) and
gdk3.window(object: expr) match for: (Widget)
How to fix it?
I used the word "database" in the generic sense.
Basically, go to any good shopping website (eg, wayfair, or amazon, or google
shopping, for example), and see what that website "knows" about coffee tables.
If you take a little time and study the website, I think you'll realize that
it's a
14 matches
Mail list logo