Hello world/Standard error: Difference between revisions

debug.warn is deprecated. keep long explanations for newbie example
(Emacs Lisp: Correct solution)
(debug.warn is deprecated. keep long explanations for newbie example)
Line 1,227:
=={{header|Zig}}==
<lang zig>const std = @import("std");
pub fn main() !void {
 
try std.io.getStdErr().writer().writeAll("Goodbye, World!\n");
const debug = std.debug;
// debug messages are also printed to stderr
const io = std.io;
//std.debug.warnprint("Goodbye, World!\n", .{});
 
test "hello world/standard error" {
const stderr = &io.getStdErr().outStream().stream;
try stderr.write("\nGoodbye, World!\n");
try stderr.print("Goodbye, {}\n", .{"World!"});
 
// Simpler API; any errors occured when writing to stderr are dismissed.
debug.warn("Goodbye, World!\n", .{});
}</lang>
 
37

edits