Do you have to use 'ref' for the field types within ref objects?

2022-11-28 Thread cagyul
It is a strange thing to be told that to understand something in Nim you first have to go and understand it in another language. The prevalence of the `ref` issue is a clear indication that the existing didactic material is insufficient.

How to get cursor position?

2022-09-22 Thread cagyul
Nice !

How to get cursor position?

2022-09-20 Thread cagyul
I wrote this just for myself and never ever expected to make it public! I will modify the code as suggested and try to make a PR, having never done so before. (I am just an amateur programmer)

How to get cursor position?

2022-09-19 Thread cagyul
I would like to offer the following code ,which I modified from a previous post a few years ago my apologies to the original poster). This is far from elegant or efficient, but it does the job. import terminal type Cursor* = tuple[x,y: int] # for the getcursorpos procedure var cursor*: Cursor

parseint not defined for char.

2022-03-29 Thread cagyul
Thanks, this is much appreciated. I am starting to get it now

parseint not defined for char.

2022-03-28 Thread cagyul
Thank you for your comments. I have just read Harper and it helps in understanding the theoretical side of the matter. But I still don't know what static type I should use to replace strings (pre-defined arrays of characters ?). I have Sedwick (Pascal examples) and will re-consult it but only af

parseint not defined for char.

2022-03-28 Thread cagyul
"As your programs grow bigger, avoid the string datatype. string indicates a lack of structure, it's effectively dynamically typed code. Use the static type system to the best of your abilities." Another example of a simple sentence that, as an amateur (beginner) programmer will have me scratch

Difference between two dates

2022-01-27 Thread cagyul
Or you can simply calculate the difference in their Julian day numbers.

Choosenim 0.8.0 now available

2021-10-04 Thread cagyul
All is well now. Thank you

Choosenim 0.8.0 now available

2021-10-03 Thread cagyul
After updating choosenim I tried 'choosenim update stable' and got the following message; Error: unhandled exception: SSL support is not available. Cannot connect over SSL. Compile with -d:ssl to enable. [HttpRequestError]

SIGILL: Illegal operation with an var parameter

2020-11-06 Thread cagyul
Indeed, word meanings depend on the contexts. But why do you define it as a func rather than a proc? Is there some spatial or chronometric advantage or is it just a personal preference? I am new to Nim and I just want to better understand the difference between the two.

SIGILL: Illegal operation with an var parameter

2020-11-05 Thread cagyul
My mathematical bent cringes at the notion of a function that does not return anything. Why not define it as a proc ?