[PATCH] doc: Fix grammar errors in tutorial.md

26 views
Skip to first unread message

Lewis Chan

<baiwfg2@gmail.com>
unread,
Dec 16, 2025, 4:44:16 AM (9 days ago) Dec 16
to seastar-dev@googlegroups.com, Lewis Chan
Signed-off-by: Lewis Chan <bai...@gmail.com>
---
doc/tutorial.md | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/doc/tutorial.md b/doc/tutorial.md
index fdcc922d..a8ca911e 100644
--- a/doc/tutorial.md
+++ b/doc/tutorial.md
@@ -2155,7 +2155,7 @@ From this output, we have no way of knowing that the exception was thrown in `g(
```
#include <util/backtrace.hh>
seastar::future<> g() {
- return seastar::make_exception_future_with_backtrace<>(std::runtime_error("hello"));
+ return seastar::make_exception_future_with_backtrace<void>(std::runtime_error("hello"));
}
```
Now the output looks like
@@ -2376,7 +2376,7 @@ Consider the following asynchronous function `loop()`, which loops until some sh
```cpp
seastar::future<long> loop(int parallelism, bool& stop) {
return seastar::do_with(0L, [parallelism, &stop] (long& counter) {
- return seastar::parallel_for_each(std::views::iota(0u, parallelism),
+ return seastar::parallel_for_each(std::views::iota(0, parallelism),
[&stop, &counter] (unsigned c) {
return seastar::do_until([&stop] { return stop; }, [&counter] {
++counter;
@@ -2497,14 +2497,14 @@ In conjunction with seastar::app_template, initialization and cleanup look like
int main(int argc, char** argv) {
seastar::app_template app;
return app.run(argc, argv, [] {
- return seastar::async() {
+ return seastar::async([] {
std::cout << "Hello world\n";
my_class my_object;
// ... more code

// my_object will be destroyed here
return 0;
- });
+ }));
}
```

@@ -2519,7 +2519,7 @@ use of the seastar::defer() function to schedule an arbitrary cleanup function:
int main(int argc, char** argv) {
seastar::app_template app;
return app.run(argc, argv, [] {
- return seastar::async() {
+ return seastar::async([] {
std::cout << "Hello world\n";
my_class my_object;
// ... more code
@@ -2535,6 +2535,7 @@ int main(int argc, char** argv) {

// my_object will be destroyed here
return 0;
+ })
});
}
```
--
2.43.0

Nadav Har'El

<nyh@scylladb.com>
unread,
Dec 16, 2025, 4:50:33 AM (9 days ago) Dec 16
to Lewis Chan, seastar-dev@googlegroups.com
On Tue, Dec 16, 2025 at 11:44 AM Lewis Chan <bai...@gmail.com> wrote:
Signed-off-by: Lewis Chan <bai...@gmail.com>
---
 doc/tutorial.md | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/doc/tutorial.md b/doc/tutorial.md
index fdcc922d..a8ca911e 100644
--- a/doc/tutorial.md
+++ b/doc/tutorial.md
@@ -2155,7 +2155,7 @@ From this output, we have no way of knowing that the exception was thrown in `g(
 ```
 #include <util/backtrace.hh>
 seastar::future<> g() {
-    return seastar::make_exception_future_with_backtrace<>(std::runtime_error("hello"));
+    return seastar::make_exception_future_with_backtrace<void>(std::runtime_error("hello"));

We use make_exception_future<> in a bazillion places and it works just fine, no need to write make_exception_future<void>.

Is make_exception_future_with_backtrace<> really an error? Maybe it should be fixed in that template, not in the documentation?
 
 }
 ```

 Now the output looks like
@@ -2376,7 +2376,7 @@ Consider the following asynchronous function `loop()`, which loops until some sh
 ```cpp
 seastar::future<long> loop(int parallelism, bool& stop) {
     return seastar::do_with(0L, [parallelism, &stop] (long& counter) {
-        return seastar::parallel_for_each(std::views::iota(0u, parallelism),
+        return seastar::parallel_for_each(std::views::iota(0, parallelism),

What's wrong with 0u? It's been part of C++ since around 30 years.
 
             [&stop, &counter]  (unsigned c) {
                 return seastar::do_until([&stop] { return stop; }, [&counter] {
                     ++counter;
@@ -2497,14 +2497,14 @@ In conjunction with seastar::app_template, initialization and cleanup look like
 int main(int argc, char** argv) {
     seastar::app_template app;
     return app.run(argc, argv, [] {
-        return seastar::async() {
+        return seastar::async([] {

Yes, this definitely looks like a syntax error.
 
             std::cout << "Hello world\n";
             my_class my_object;
             // ... more code

             // my_object will be destroyed here
             return 0;
-    });
+    }));
 }
 ```

@@ -2519,7 +2519,7 @@ use of the seastar::defer() function to schedule an arbitrary cleanup function:
 int main(int argc, char** argv) {
     seastar::app_template app;
     return app.run(argc, argv, [] {
-        return seastar::async() {
+        return seastar::async([] {
             std::cout << "Hello world\n";
             my_class my_object;
             // ... more code
@@ -2535,6 +2535,7 @@ int main(int argc, char** argv) {

             // my_object will be destroyed here
             return 0;
+        })
     });
 }
 ```
--
2.43.0

--
You received this message because you are subscribed to the Google Groups "seastar-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seastar-dev...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/seastar-dev/20251216094347.119744-1-baiwfg2%40gmail.com.

Łukasz Kurowski

<crackcomm@gmail.com>
unread,
Dec 16, 2025, 4:54:46 AM (9 days ago) Dec 16
to Nadav Har'El, Lewis Chan, seastar-dev@googlegroups.com
> Is make_exception_future_with_backtrace<> really an error? Maybe it should be fixed in that template, not in the documentation?

I checked and it actually is

Chan Lewis

<baiwfg2@gmail.com>
unread,
Dec 16, 2025, 5:26:47 AM (9 days ago) Dec 16
to Nadav Har'El, seastar-dev@googlegroups.com


Nadav Har'El <n...@scylladb.com> 于2025年12月16日周二 17:50写道:

On Tue, Dec 16, 2025 at 11:44 AM Lewis Chan <bai...@gmail.com> wrote:
Signed-off-by: Lewis Chan <bai...@gmail.com>
---
 doc/tutorial.md | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/doc/tutorial.md b/doc/tutorial.md
index fdcc922d..a8ca911e 100644
--- a/doc/tutorial.md
+++ b/doc/tutorial.md
@@ -2155,7 +2155,7 @@ From this output, we have no way of knowing that the exception was thrown in `g(
 ```
 #include <util/backtrace.hh>
 seastar::future<> g() {
-    return seastar::make_exception_future_with_backtrace<>(std::runtime_error("hello"));
+    return seastar::make_exception_future_with_backtrace<void>(std::runtime_error("hello"));

We use make_exception_future<> in a bazillion places and it works just fine, no need to write make_exception_future<void>.

Is make_exception_future_with_backtrace<> really an error? Maybe it should be fixed in that template, not in the documentation?

Yes, it does throw errors. I check the code and find that make_exception_future_with_backtrace doesn't have a default T value like make_exception_future<>. I think we may need to give T a default void ?


 
 
 }
 ```
 Now the output looks like
@@ -2376,7 +2376,7 @@ Consider the following asynchronous function `loop()`, which loops until some sh
 ```cpp
 seastar::future<long> loop(int parallelism, bool& stop) {
     return seastar::do_with(0L, [parallelism, &stop] (long& counter) {
-        return seastar::parallel_for_each(std::views::iota(0u, parallelism),
+        return seastar::parallel_for_each(std::views::iota(0, parallelism),

What's wrong with 0u? It's been part of C++ since around 30 years.

parallelism has an int type, and doesn't match. So the compiler complains. remove 'u' to avoid implicit conversion

Chan Lewis

<baiwfg2@gmail.com>
unread,
Dec 16, 2025, 5:31:21 AM (9 days ago) Dec 16
to Nadav Har'El, seastar-dev@googlegroups.com
Hi. This is my first time submiting a patch for seastar project. I only use git send-mail to generate this patch. I haven't created an issue or PR on the repo side. Is this the right way to do it ?

Chan Lewis <bai...@gmail.com> 于2025年12月16日周二 18:26写道:
Reply all
Reply to author
Forward
0 new messages