Nimsuggest and Manjaro Nim installation

2024-06-10 Thread lscrd
The problem has been solved. Thanks to the team for the correction.

Nimsuggest and Manjaro Nim installation

2024-06-07 Thread lscrd
Looking again at your answer, it seems obvious. It looks like I was not wide-awake at this moment. My apologies.

Nimsuggest and Manjaro Nim installation

2024-06-07 Thread lscrd
I guess this is supposed to be ironic. Contrary to what you said, the compiler and _nimsuggest_ doesn’t use the same rule. I have no time to find the reason for this, but one thing is sure: if _nim_ binary is in /usr/bin, the compiler does the right thing and expects the library to be in /usr/l

Nimsuggest and Manjaro Nim installation

2024-06-07 Thread lscrd
You are right. If the compiler used the same logic as that of _nimsuggest_ to find the library location, it should not work. This is strange. To understand what going on, I looked at the compiler source. In the module “options.nim” of the compiler, the procedure _getPrefixDir_ has a special case

Nimsuggest and Manjaro Nim installation

2024-06-07 Thread lscrd
Thanks for your detailed answer. It makes sense.

Nimsuggest and Manjaro Nim installation

2024-06-06 Thread lscrd
I tried to use Nim standard installation on Manjaro and encountered a problem with _nimsuggest_. When running _nimsuggest --v3_ , I get an exception with the message _cannot open '/usr/lib/system.nim'_. Manjaro installs Nim binary in /usr/bin and the library in /usr/lib/nim. Looking at the sour

`nph` opinonated formatter v0.2

2023-12-27 Thread lscrd
Sorry, I should have taken a better look at the previous posts 🙁. For me, it looks like a bug in the parser. As you said, it seems that the parser has swallowed the semicolon when processing the inner proc. Using a modified example with only standard types, I found two workarounds: either add a

`nph` opinonated formatter v0.2

2023-12-27 Thread lscrd
Sorry, I don’t understand why using `;` is not possible for identifiers with defaults. The following example is perfectly valid and I don’t see any parsing problem: proc p(a: int; b: char; c, d = 3; e = 4) = discard Run Am I missing something? Is there any problem wit

Hello `nph`, an opinionated source code formatter for Nim

2023-12-11 Thread lscrd
Personally, I systematically use `;` in parameter list as this is more readable than `,` when successive parameters have the same type. proc p(x, y: int, c: char) Run seems to me confusing compared to proc p(x, y: int; c: char) Run

Advent of Nim 2023

2023-12-02 Thread lscrd
My solutions, all written in Nim, can be found here: <https://github.com/lscrd/AdventOfCode2023> Solutions for years 2016 to 2022 can also be found on <https://github.com/lscrd>.

A few (perhaps naive) questions

2023-08-08 Thread lscrd
Yes, but until the links are changed you have to specify the URL: nimble install https://github.com/adokitkat/nim-gmp nimble install https://github.com/adokitkat/bignum Run Don’t forget to remove the old versions.

A few (perhaps naive) questions

2023-08-08 Thread lscrd
Thank you! Great work!

A few (perhaps naive) questions

2023-08-07 Thread lscrd
“bignum” no longer works. There is a syntactical error in the “gmp” wrapper used by “bignum”. For some reason, it worked with 1.6, but 2.0 is less permissive regarding the position of pragmas. The issue has been reported since December (for Nim 2.0 RC). But you know it as you have just added a

“NIM” backronyms

2023-05-23 Thread lscrd
Not in my… Nim!

Checking for exact floating-point representations

2023-05-01 Thread lscrd
You are right. For instance 0.6 cannot be represented exactly as a binary float.

Type mismatch with echo and trouble accessing Type fields

2023-04-19 Thread lscrd
If you do this, you will encounter problems if your ref type contains fields which are also references. At what depth will you stop? And, worse, if there are cycles, you will enter in an infinite recursion.

Advent of Nim 2022

2022-12-11 Thread lscrd
I suppose that the bug will be fixed in 1.6.12 version but I don’t know when this version will be released.

Advent of Nim 2022

2022-12-06 Thread lscrd
My solutions are available here: <https://github.com/lscrd/AdventOfCode2022> When solving day 06, I encountered a bug in Nim 1.6.10 "strutils" library. In "s.find(sub, start, last)", if "last" is equal to 0, this is interpreted as "s.high" w

Nim Compiler Issues

2022-09-10 Thread lscrd
It seems that you want to define arras containing values of different types. This is not possible in Nim and it doesn’t matter if the type is already known (predefined) or not. When you use the union operator `or` to define the type “byte”, it means that you can define a common behavior for var

Nim Compiler Issues

2022-09-09 Thread lscrd
I don’t see how this program can compile. Here is a version which compiles: # worked type byte = range[uint8(0)..uint8(128)] # or just uint8 without the range type bytearray[H: static uint64] = array[uint64(0)..H, byte] const b = byte('a') const ba: bytearray[1]

How to have multiple (alternate) return types?

2022-09-02 Thread lscrd
But this is a valid return type, provided the actual return type is known at compile time. This is valid and the result is what you expect: proc test(x: static bool): string | int = when x: 1 else: "hello" echo test true echo test false

Can if statements be used as expressions everywhere?

2022-02-12 Thread lscrd
Yes, but, nevertheless, in this case, you have to use parentheses. This is the same thing with an if expression: proc p(b: bool) = var x = if b: 3 else: 4 # Compile. var y = 1 + if b: 3 else: 4 # Doesn’t compile. var z = 1 + (if b: 3 else: 4) # Compile

Can if statements be used as expressions everywhere?

2022-02-12 Thread lscrd
You need to use parentheses to turn the case statement into an expression: import std/strutils func score*(word: string): int = for c in word: result += (case toUpperAscii(c) of {'A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T'}: 1 of {'D', '

Trojan:Win32/Wacatac.B!ml

2022-01-24 Thread lscrd
> Exactly, it's not an easy task. Why not just submit a false positive report? It was already done for previous versions of Nim. Perhaps it would be possible to take out a subscription because things don't seem likely to change anytime soon 🙂.

Trojan:Win32/Wacatac.B!ml

2022-01-23 Thread lscrd
Yes, it may happen. I once encountered this problem when installing one of our programs on a customer computer. Fortunately, the antivirus software had not been updated for some time and after update the false positive disappeared. In fact, I suppose it happens of lot of time, but nobody cares e

Trojan:Win32/Wacatac.B!ml

2022-01-23 Thread lscrd
This isn’t the job of developers to provide binaries to Microsoft (and all other virus software providers) each time they release a new version. It’s the job of antivirus software developers to make sure they provide correct signatures for malware detection. A false positive may occur, but when

Trojan:Win32/Wacatac.B!ml

2022-01-23 Thread lscrd
Apparently, this doesn’t work well as the problem is encountered with each new version of Nim. When you have signaled the problem a first time, then a second time, etc. it should be evident for the antivirus software maker that it should be careful and check that its product doesn’t falsely dete

Novice Question: Implement the Step functionality in VBA

2022-01-14 Thread lscrd
Equivalent to your solution, but more concise: iterator mystep(a, b: int): int = for i in countup(a, b): yield i for i in countdown(a, b + 1): yield i Run

Advent of Nim 2021

2021-12-05 Thread lscrd
My repository is here: <https://github.com/lscrd/AdventOfCode2021>

Nim 1.6.0 GTK cast cstring ?

2021-10-21 Thread lscrd
No, there is an implicit conversion when passing a `string` to a `cstring`. But it seems that nim 1.6.0 has introduced a check to make sure that the argument cannot be modified. This triggers the warning: proc p(s: cstring) = discard var s = "abc" p(s)

Question about algorithm.upperBound

2021-10-06 Thread lscrd
Yes, this is a known documentation error which has been fixed in the development version. Here is the doc for the function in this version: > Returns the index of the first element in `a` that is greater than `key`, or > last if no such element is found.

Question about "minExponent" and "maxExponent" in module "fenv"

2021-09-24 Thread lscrd
Hi all, For a float32, we get -125 for minExponent and 128 for maxExponent. It’s a bit surprising as the whole range fo exponents is -127..128, so we would expect minExponent to be -127. If we limit to normal numbers, the whole range is -126..127. For a float64, we get -1021 and 1024 when we w

Print why assert failed?

2021-08-14 Thread lscrd
You may put anything in the message, for instance the value of the arguments: import strformat let a = 1 let b = 2 assert a == b, &"Expected {b}, got {a}" Run Of course, displaying the arguments by default would be an improvement but, most of the time,

Print why assert failed?

2021-08-14 Thread lscrd
It is possible to add a message to `assert`: let a = 1 let b = 2 assert a == b, "Something didn't work." Run And we get: Error: unhandled exception: /tmp/test.nim(4, 8) `a == b` Something didn't work. [AssertionDefect] Run

Nim earns mention in the news (unfortunately?)

2021-07-29 Thread lscrd
Sure. In any domain, the worst thing is to be totally ignored.

How can I point to (the memory adress of) a variable?

2021-07-20 Thread lscrd
> I've read the first part of the tutorial but I found that it needs > improvement so here I am asking. In a tutorial which is intended to learn the basics of the language, there is no need to describe unsafe features. If you want to use there features, you have a lot to learn before. Nim is no

Safe `enum` conversion

2021-07-05 Thread lscrd
I think that regarding the possibility to catch defects, we are in a transitional state. By default, defects are catchable but this will change in the future. Personally, I never rely on the possibility to catch defects. That means that if I want to check for overflow, I don’t try to do the oper

Safe `enum` conversion

2021-07-04 Thread lscrd
The problem with: type X = enum Z var a = 42 var b = X(a) Run is that it raises a RangeDefect exception and that defects are considered non catchable (in fact, by default, they are, for now…). The distinction between catchable exceptions and defects

An efficient deque -> array proc to enable index access to all internal values?

2021-06-30 Thread lscrd
Maybe I didn’t understand your question but with Nim deques there is no need to use an array proc to access an element. You can do it directly. Here is an example of what can be done with Nim deques: import deques var d = [1, 3, 5, 7].toDeque echo d d.addFirst

Formatting a float to currency

2021-06-27 Thread lscrd
`insertSep` from module `strutils` is able to insert separators, but it doesn’t work well with floats: import strutils echo ($12345.67).insertSep(',')# 12,345,.67. Run So we have to do some work to get the right result: import strutils var s =

import unsigned error

2021-06-20 Thread lscrd
"unsigned" is an old module which has been deprecated and no longer exists. I’m surprised by this error as I have "bignum" installed on my machine and didn’t encounter any problem. The last version of "bignum" is 1.0.4, yours seems to be 1.0.0, so the problem may be just to install the most rec

lowerBound and upperBoud from module “algorithm”

2021-06-13 Thread lscrd
You are right. I checked and this is the reason why I asked the question here. Release 1.4.8 is recent, so I was surprised that it exists a difference with the development version. To better understand, I checked and found that the commit has been done on January 2. So, I suppose that the docum

lowerBound and upperBoud from module “algorithm”

2021-06-12 Thread lscrd
Thanks. So, it was found before and correction is in the pipe. Fine!

lowerBound and upperBoud from module “algorithm”

2021-06-12 Thread lscrd
When trying to use these functions I got a behavior not consistent with the documentation. Here is an example: import algorithm let a = [2, 4, 6, 8] echo a.lowerBound(4) # display 1 echo a.upperBound(4) # display 2 Run The documentation for`lowe

high(Natural) == high(int)

2021-06-02 Thread lscrd
If you add underflow check to unsigned numbers, your example raises an exception and it is what personally I would expect. The choice to use modular arithmetic is the reason why we encounter such an odd behavior. Of course, with unsigned integers there is more chance to get an underflow than an

high(Natural) == high(int)

2021-06-02 Thread lscrd
It would not loop if an exception was raised when computing `a.len - 4`. Signed numbers can also wrap around and cause nasty bugs, but fortunately in Nim overflows are checked for operations on signed integers. So, just add underflow/overflow check on unsigned numbers rather than using modular

Nimble detected as Trojan.Gen.MBT by Symantec Endpoint Protection v14

2021-06-01 Thread lscrd
Yes, it would solve the issue regarding Nim compiler and tools. But it would not prevent possible false positives with other programs written in Nim. The AV software vendors must refine their criteria regarding what is actually a malware written in Nim. Should we search what in the binaries has

Nimble detected as Trojan.Gen.MBT by Symantec Endpoint Protection v14

2021-06-01 Thread lscrd
Yes, but as I already said, this should not occur if AV software vendors did correctly their job. They should detect patterns which are specific to malware and not flag as suspicious any software written in Nim, especially Nim tools. Of course, from their point of view, it is preferable to get f

Date issue. What happened in 1940?

2021-05-27 Thread lscrd
Yes I understand, but as I said the problem is not only with DST but also with time zone changes. When a country changes its timezone as it was the case several times in France between 1902 and 1968 (in my second example), this may cause troubles when we want to count the number of days between

Date issue. What happened in 1940?

2021-05-27 Thread lscrd
Yes, it seems to be a known problem. I never encountered it before but also never played a lot with dates. Better avoid local time is some cases and use UTC which is much more predictable.

Date issue. What happened in 1940?

2021-05-27 Thread lscrd
Thanks all for your answers. I indeed live in France and I was aware that there are hour changes when France was occupied. But I didn’t know that there was a DST on 1940 February 25th (and in fact many DST before war; this is in fact an old and unpleasant idea). So this makes sense… in this exa

Date issue. What happened in 1940?

2021-05-26 Thread lscrd
No, I checked and 1940 is actually recognized as a leap year. But when computing the difference between the two dates, one hour is missing which causes the error when converting in days. This is really strange.

Date issue. What happened in 1940?

2021-05-26 Thread lscrd
Hi, When trying to compute a difference between two dates, I encountered a problem. Here a small program to show the issue: echo (parse("1940-03-01", "-MM-dd") - parse("1940-02-01", "-MM-dd")).inDays Run And the result is 28 instead of 29. For other years such as

How to escape colon in the '&' macro in strformat ?

2021-05-23 Thread lscrd
Ah, I see, I had switched to development version. Indeed, it doesn’t compile with 1.4.6.

How to escape colon in the '&' macro in strformat ?

2021-05-22 Thread lscrd
This works: import strformat echo &"""{"url = http\://example.com"}""" Run

Python style in Nim

2021-05-18 Thread lscrd
After some reluctance, as I was used to Python list/dict/set comprehensions, I finally tried `collect` and I’m rather satisfied with it. I find important that it doesn’t cause any overhead. I appreciate the procedures and templates from `sequtils` too (especially those with `it`) but they creat

Int/Floating Point Cast Result

2021-05-17 Thread lscrd
To be clear: echo int(1.6)# 1 echo toInt(1.6) # 2 Run

Nim 2.0 -- thoughts

2021-05-15 Thread lscrd
> Can you post code/make a thread about this maybe? I'd wager that if it is > slower that it could be helpful to know why. Good idea. But I will have to find some significant examples. I will think about it.

Nim 2.0 -- thoughts

2021-05-15 Thread lscrd
> Maybe because you are not using sink and lent annotations? Also using sink > when it's unnecessary may introduce an unwanted copy. The compiler emits a warning when there is a potential loss of performance with sink parameters. But, indeed, I cannot be sure that there is not some tweaking to

Nim 2.0 -- thoughts

2021-05-15 Thread lscrd
What about the performance of `orc`? On my programs, `arc` or `orc` are generally slower than the default GC. I don’t know why, as they are expected to be faster. In some cases, indeed, I got an impressive boost with `arc/orc`, but not very often, alas! I know that it depends on what the progra

Which parameter list delimiter is more "standard"? Commas or semicolons?

2021-05-13 Thread lscrd
Personally, after using colons, I switched to semicolons. I find `proc p(x, y: int; s: string` more readable that `proc p(x, y: int, s: string)`. Of course, this is only a matter of preference. And I don’t care about what is done in other languages. I think that what is important is readability

learn Nim regular expressions - regex, re , NRE

2021-05-02 Thread lscrd
I think it would be inconsistent to mark `re` as deprecated and advise to use `regex` instead, while `re` is in the standard library and `regex` is not. If `regex` is now the right choice, the first thing to do is to add it in the standard library. Deprecation of `re` could follow.

How to make Nim more popular

2021-05-02 Thread lscrd
Yes, this is a long list, but these are mostly drafted tasks. I will look at them later. As regards old code, you are right, but I updated it and replaced it in some rare cases. For now, all examples in the main tasks run with Nim version 1.4, at least until letter Y (letter Z is in progress).

nim-1.4.6_x64.zip/bin/nimble.exe reports as Trojan:Win32/Zpevdo.B

2021-05-02 Thread lscrd
I agree. When many AV software have exactly the same behavior on the same binaries at the same moment, this is highly suspicious. And the extraction of a signature from malware is clearly poorly done. No check has been done to insure that this signature is specific enough. When the compiler of

How to make Nim more popular

2021-05-02 Thread lscrd
Regarding Rosetta contributions, I’m afraid it’s too late. Almost all tasks have now a Nim solution. Of course, it is always possible to improve an existing solution, to replace it or to add a new solution, using another algorithm or another library. And there is still a lot of work to do on dr

Why learn NIM

2021-05-01 Thread lscrd
Your "myarray' type has no static bounds, so as soon as you use it, a descriptor is created. When you transmit a static array to a parameter of this type, the compiler generate code to build a descriptor which contains the lower bound, the upper bound and the address of the actual data. Pascal,

Why learn NIM

2021-05-01 Thread lscrd
> They may require a small number of additional bytes to track details, say the > minimum and maximum indices and probably the length, but many people judge > that worth the cost. They will require additional data only if they are dynamic arrays. If you declare `var a: array[5..100] of integer;

Why learn NIM

2021-05-01 Thread lscrd
If your array starts at index 1 and is stored at some address `a`, when generating code to access to `a[i]`, you don’t subtract one to `i`, but you use as starting address that of a fictive element `a[0]`. For instance, if the array contains 64 bits integers, you use `a - 8` as starting address

nim-1.4.6_x64.zip/bin/nimble.exe reports as Trojan:Win32/Zpevdo.B

2021-04-29 Thread lscrd
It seems this will become a serious problem for Nim, not only because the compiler and the tools will be declared as suspicious, but also because all programs produced compiled by the Nim compiler may become suspicious at term. The AV software vendors seems to have chosen the lazy way to fight t

XML parsing performance

2021-04-27 Thread lscrd
I agree. And if we choose release mode as default, some people will complain that there is not enough assistance when an error occurs.

XML parsing performance

2021-04-26 Thread lscrd
I understand that embedded environments are constrained. But, nowadays, this is more for an economical reason than for a technical reason. More memory means that each unit costs more and when you want to sell millions of units, this is indeed something to take in consideration. But this positio

XML parsing performance

2021-04-26 Thread lscrd
The problem with the debug mode is that, for people who never used languages compiling to native code, it doesn’t explicitly states that in this mode programs will be considerably slower. Many will think that the program will be bigger (containing debugging data) which is true indeed, but will n

nim-1.4.6_x64.zip/bin/nimble.exe reports as Trojan:Win32/Zpevdo.B

2021-04-20 Thread lscrd
That’s nothing new. Antivirus designers prefer false positives to false negatives. It’s understandable: missing a virus may have terrible consequences while false alerts are only an annoyance. Now, what can be done when there is so much false positives? For sure, there is some pattern which has

Unicode string print - the four faces look different when printing - why?

2021-04-19 Thread lscrd
You are right. I have tried with classic classic emojis which have code from U+1F600 to U+1F64F. And, in my terminal, they are correctly displayed. But the four emojis which have code from U+01F466 to 01F469 are not correctly displayed. I tried to display them in a text editor, with no success.

nim program name with spaces

2021-04-03 Thread lscrd
It is perfectly possible to use spaces in a file name: just use non breaking space instead of normal space. This works because the compiler accepts Unicode characters in module names. Now, I don’t recommend it; this is very misleading :-).

'ord' cannot be passed to a procvar

2021-03-20 Thread lscrd
And you can do instead: echo ['A', 'B', 'C', 'D'].mapIt(ord(it)) Run

Defects and CatchableErrors

2021-02-17 Thread lscrd
No, I don’t think so. This works (without --panics:on: of course): var x = 0 try: echo 1 div x except DivByZeroDefect: echo "ok" Run

Simple recursion really slow?

2021-01-24 Thread lscrd
And I tried the example with options `-d:release --passC:-flto` and decreased the time to 14 seconds ! But with `-d:danger --passC:-flto`, this is still more than 30 seconds.

Advent of Nim 2020 megathread

2020-12-24 Thread lscrd
About coordinates system for hexagon grids, I found this: For day 24 AOC, I used the axial coordinates and a set of black tiles too. In project Euler there are some problems involving hexagon grids.

Advent of Nim 2020 megathread

2020-12-23 Thread lscrd
Doubly linked ring works and I don’t see why they shouldn’t. My solution uses: – a doubly linked ring which makes easy to remove and insert nodes. – a list of nodes allocated once, removed from ring and reinserted when needed; – a sequence (not a table but a table would also work) to map values

How do you pick an element from a set?

2020-12-16 Thread lscrd
I used sets for Day 16 AOC too. I declared a procedure to retrieve the only value of a singleton: proc value(posSet: set[Position]): Position = for pos in posSet: return pos Run But your solution is fine.

Advent of Nim 2020 megathread

2020-12-14 Thread lscrd
Yes and it’s intended. All values in the examples contains only 0 and 1. You have to read carefully the detailed description to see that 11 is decimal 11 and 101 is decimal 101. This is a simple trap but quite effective.

Advent of Nim 2020 megathread

2020-12-08 Thread lscrd
> What a pity, I like the conciseness of scanf for this use case because the > pattern visually matches the input and performs parseInt for you, all in one > shot. Yes, you are right and I hesitated to use `scanf` for this reason. I thought about using `scanf` then `parseEnum`, as in your last

Advent of Nim 2020 megathread

2020-12-08 Thread lscrd
This is a warning and I don’t think you can do anything to prevent it. But in this case, the copy is not really a problem. You can replace `scanf` and the following statement by these two statements: let fields = line.split(' ') result.add((fields[0], parseInt(fields[1]))

Advent of Nim 2020 megathread

2020-12-06 Thread lscrd
There are problems when you do operations between a set of a type and a set of a subtype of the type. I reported them here: In fact, this is probably the same bug with different consequences. And it wa

Advent of Nim 2020 megathread

2020-12-06 Thread lscrd
I found two bugs with sets when solving the 6th day problem. First bug causes an error in C compilation. It seems to be related/identical to an already known bug. Second bug is an error in the code produced with makes the program give wrong results.

Advent of Nim 2020 megathread

2020-12-03 Thread lscrd
My solutions are here: <https://github.com/lscrd/-AdventOfCode2020> Please note that I always publish them with some delay.

How to rewrite nim programming langauge to be pythonic as possible?

2020-11-29 Thread lscrd
Yes, you are right. This is the standard rounding in IEEE 754. I suppose that with this rounding, errors in one direction better compensates errors in another direction.

Strange error message from collections/sets.nim

2020-11-26 Thread lscrd
> Indentation's purpose is to show scope, I'm uncertain if alignment even makes > more readable code. No, indentation is certainly not a way to indicate scoping as in old languages, such as Pascal, an IF, a FOR or a WHILE statement doesn’t create a new scope. Even in Python an if, a for or a wh

Strange error message from collections/sets.nim

2020-11-25 Thread lscrd
We want alignment for instance in this case: if some_long_expression and another_long_expression and another_one: Run Of course, we could use parentheses and write, using only indentation: if ( some_long_expression and another_lon

Changer VSCode pour VSCodium

2020-11-23 Thread lscrd
I have encountered this bug recently after an update of my system (Manjaro). This is in fact an Electron bug and downgrading to previous version of Electron solved the issue. The bug caused a warning when compiling from the VSCode terminal. Not a big problem. But, for some reason, maybe unrelat

Subrange check during initialisation

2020-10-29 Thread lscrd
The check is done for the implicit variable “result” and we get the usual warning: `Warning: Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]` Why not for a normal variable? type DiceVal = range[1..6] proc throwDic

Generics constrain with numbers

2020-09-10 Thread lscrd
This way: func myfunc(number: SomeInteger) = Run

Any easy way to compare `==` object variants?

2020-09-06 Thread lscrd
To compare records, Nim use the `fields` iterator which doesn’t work for variant records. So, you have to define your own `==` proc: type Obj = object case type: bool of false: a: int of true: b: int proc `

How can i separate the integer part of a number from its decimal part ?

2020-09-03 Thread lscrd
There is this: Not widely spoken I suppose 🙂.

How can i separate the integer part of a number from its decimal part ?

2020-09-03 Thread lscrd
> It's really not, as can be seen by reading that Wikipedia article past the > first six words. The problem is that in these six words, fractional part and decimal part are presented as synonyms. So, this is bad wording. And, actually, never in the article, decimal part is really defined. Ther

How can i separate the integer part of a number from its decimal part ?

2020-09-02 Thread lscrd
Yes, it seems that in French “partie décimale” is more frequently used, but “partie fractionnaire” is also acceptable: Some purists say that “fractional part” is inadequate as, for an irrational num

Blog post about strict funcs

2020-08-29 Thread lscrd
Thanks. That makes sense.

Blog post about strict funcs

2020-08-28 Thread lscrd
This is the pragma {.noSideEffect.} for `add` which causes the error. Adding a block {.noSideEffect.} in `p` doesn’t change anything. But in fact, for now, I don’t want to make the program compile. I just want to understand the behavior. I simplified again my examples (no need for an object) an

Blog post about strict funcs

2020-08-28 Thread lscrd
OK, but that doesn’t explain why my second examples compiles. We are in the same situation where an alias is created when copying a reference.

  1   2   >