From e475e9d437474979ee5725d19eaeccca7b168406 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Sat, 8 Mar 2025 14:02:35 +0200 Subject: [PATCH] examples: shorten the periodic output of examples/hot_reload/message.v --- examples/hot_reload/message.v | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/examples/hot_reload/message.v b/examples/hot_reload/message.v index c6d7cdd07..391e13ebf 100644 --- a/examples/hot_reload/message.v +++ b/examples/hot_reload/message.v @@ -6,20 +6,24 @@ import v.live struct App { mut: - x int - counter int + x int + c int } @[live] fn print_message(mut app App) { i := live.info() - println('OK reloads: ${i.reloads_ok:4d} | Total reloads: ${i.reloads:4d} | Hello! Modify this message while the program is running. app: ${voidptr(app)} | app.x: ${app.x:6} | app.counter: ${app.counter:6}') - // app.x = 99 // try changing this to another value, while the program is running ... - app.counter++ + println('Hello! Modify this message. OK reloads: ${i.reloads_ok:2d} | Total: ${i.reloads:2d} | app: ${voidptr(app)} | app.c: ${app.c:4} | app.x: ${app.x:12}') + // app.x = app.x * 3 + 1 // try changing this to another value, while the program is running ... + // app.x = 0 + app.c++ } fn main() { unbuffer_stdout() + println('=============================================================') + println('== Modify the message below, while the program is running: ==') + println('=============================================================') mut app := &App{} for { print_message(mut app) -- 2.39.5