fixme: the proc parameters always use Copy by default?

2024-01-06 Thread Yardanico
As I mentioned, the compiler doesn't always optimize, but it does when the object is big enough: type P = object x, y: int64 type P2 = object x, y, z, d: int64 proc f[T](a: T) = echo "f:", cast[int](a.addr) var a = P(x: 1, y: 2)

fixme: the proc parameters always use Copy by default?

2024-01-06 Thread aiac
* code type P = object x, y: int proc f(a: P) = echo "f:", cast[int](a.addr) var a = P(x: 1, y: 2) echo "a: ", cast[int](a.addr) f a Run * result a: 93922143641920 f:140728652581696

fixme: the proc parameters always use Copy by default?

2024-01-06 Thread Yardanico
The manual entry you mentioned uses the phrasing "is always free to pass" \- which means that it _can_ do that if it decides to do so (and if it is implemented), but not _guaranteed_.

fixme: the proc parameters always use Copy by default?

2024-01-06 Thread ElegantBeef
`seq` s and `strings` are 2 pointer sizes so do not experience that optimization their value component is passed as copy, but since they own heap data that is not copied this can be seen below: proc f(t: seq[string]) = echo "f:", cast[int](t[0].addr) proc fv(t: var se

fixme: the proc parameters always use Copy by default?

2024-01-06 Thread aiac
code: > > proc f(t: seq[string]) = > echo "f:", cast[int](t.addr) > > proc fv(t: var seq[string]) = > echo "fv:", cast[int](t.addr) > > var t = @["foo", "bar"] > echo "t:", cast[int](t.addr) > > f t > fv t > > > > Run * re

Absytree: Text editor (and tree based language framework) in Nim

2024-01-06 Thread nasl
Since you mentioned MPS, are you planning for Absytree to be a Projectional Editor?

Mastering Nim 2.0

2024-01-06 Thread j-james
Have you considered print-on-demand services? I have seen books sold through lulu.com and blurb.com. The book I have from lulu.com is of quite nice quality. I do not know if you can set profit margins on those websites, but I would imagine you can.

Absytree: Text editor (and tree based language framework) in Nim

2024-01-06 Thread nimaoth
Thanks for trying it out, and thank you for the your great libraries. I also planned on creating pull requests for those at some point, but haven't gotten to it yet

Absytree: Text editor (and tree based language framework) in Nim

2024-01-06 Thread treeform
Thank you for using chroma, vmath, ws, windy, and boxy! It looks like you forked some repos to fix issues. I should fix these issues in my versions as well. vmath - figure out JS object support. windy - some thing with Nim2.0 boxy - I think I added "ability to render to framebuffer instead of s

Nim Community Survey 2023

2024-01-06 Thread miran
> ... Sooo when the final results are published ? 🤔 "Soon" ;)

`nph` opinionated formatter v0.3

2024-01-06 Thread freeflow
Even more tongue in cheek, did you accept the status quo when you invented nim. Should everyone using nim switch back to c++. Should Newton just have shrugged his shoulder when he saw the apple fall from the tree. I think you've done a great service by inventing nim, but even you needed nim

`nph` opinionated formatter v0.3

2024-01-06 Thread Araq
> The tongue in cheek response It's a reasonable response and opinion but it's far less effort to just accept the status quo. :P

`nph` opinionated formatter v0.3

2024-01-06 Thread Araq
`elif` belongs to the `if` and is not indented either.

`nph` opinionated formatter v0.3

2024-01-06 Thread freeflow
I would present a different opinion. nph is about the visual representation of the structure of the program. For this reason I would expect the fact that 'of' belongs to 'case' to be indicated by an indent relative to the 'case'. I'm struggling to see how the 'belonging' would be shown if not by

`nph` opinionated formatter v0.3

2024-01-06 Thread xigoi
> I'm struggling to understand why, in a language that uses indentation to > enforce structure, the 'of' in case statements is aligned with the 'case' > rather than being indented. The extra indentation would be redundant because an `of` block has to belong to a `case` statement.

`nph` opinionated formatter v0.3

2024-01-06 Thread arnetheduck
Strings of dot calls sounds like a reasonable place to apply the general list logic - can you open an issue with a few examples?