StefanSalewski / NimProgrammingBook

Computer Programming with the Nim Programming Language -- A gentle Introduction
262 stars 19 forks source link

minor grammar fixes #20

Closed marek-lach closed 2 years ago

StefanSalewski commented 2 years ago

Usually, procedures and functions,

Sorry, I have no idea why the two terms should be rendered in italic.

Usually, procedures and functions, are used to group sequences of statements, that then perform a specific task.

The comma after functions makes reading the sentence for me really hard. Can you point me to to the grammar rule that indicates that this comma is necessary, or can you provide an example that uses this notation, maybe from Wikipedia or a similar serious source?

In Nim, functions are a special form of procedures, that return a result and do not modify the current state of the program.

You added comma seems to make sense, but why italics for "function"?

Your other fixes makes sense, I will apply them when I work on the book again. As you may have noticed, I have already applied LanguageTool and Grammarly apps on the text, so my hope is, that number of issues is much lower now. As I know that you are from eastern Europe, I hope that you do not suffer too much from the Russian war, and especially that you do not have to fight for Putin or to live in Russia. Best regards, Stefan Salewski.

StefanSalewski commented 2 years ago

Usually, procedures and functions are used to group sequences of statements that perform a specific task.

My feeling is still, that my sentence is not wrong. https://quillbot.com/grammar-check is happy with these two simplified variants:

Braces are used to group sequences of statements that then perform a specific task.

Braces are used to group sequences of statements that perform a specific task.

But not with your added commas.

I will try to process your other issues this evening. As you may have noticed, Mr. Rumpf has just published his first own book, so interests for my book may decrease further. And the upcoming version 2.0 of Nim may require a lot of changes.

StefanSalewski commented 2 years ago

Actually, the https://quillbot.com/ AI Paraphraser suggests this variant:

Procedures and functions are typically used to aggregate sets of statements that carry out particular tasks.

Really not bad. I think I will try this AI for a few sentences of the book which cry for improvements.

StefanSalewski commented 2 years ago

Here are the final fixes:

//Usually, procedures and functions are used //to group sequences of statements that perform a specific task. Procedures and functions are typically used to group sequences of statements that perform a specific task.

For a function declaration, we use the keyword [.key]#func# instead of [.proc]#{proc}#, and //as functions do always return a result, we have always to specify the result data type. as functions return a result, we have to specify the [.key]#result# data type.

Note that this is only a declaration so far --

Quillbot thinks that there is no comma after note in this case. Indeed, I did a lot fixes in the past, putting commas after the word note, but then grammarly removed them again.

, as we can not call a [.proc]#{proc}# before it is declared or

Quillbot is happy with this sentence:

We can not eat this food.

So I guess that cannot is not needed here. But I never understood in school why they sometimes removed the space.