[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #56419] Implementation of newline
From: |
Guillaume |
Subject: |
[Octave-bug-tracker] [bug #56419] Implementation of newline |
Date: |
Tue, 4 Jun 2019 04:49:19 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0 |
Follow-up Comment #5, bug #56419 (project octave):
Here is a new version incorporating all of the changes from comment #1.
diff -r 9e5c1d343a2c libinterp/corefcn/strfns.cc
--- a/libinterp/corefcn/strfns.cc Mon Jun 03 19:03:15 2019 -0700
+++ b/libinterp/corefcn/strfns.cc Tue Jun 04 09:45:20 2019 +0100
@@ -45,6 +45,31 @@
#include "oct-string.h"
+DEFUN (newline, args, ,
+ doc: /* -*- texinfo -*-
address@hidden {} {} newline ()
+Return the character corresponding to a newline.
+
+This is equivalent to @qcode{"@xbackslashchar{}n"}.
+
address@hidden, strjoin, strsplit}
address@hidden deftypefn */)
+{
+ if (args.length () != 0)
+ print_usage ();
+
+ static octave_value_list retval = ovl ("\n");
+
+ return retval;
+}
+
+/*
+%!assert (newline (), "\n")
+
+%!error newline (1)
+%!error [a, b] = newline ()
+*/
+
DEFUN (char, args, ,
doc: /* -*- texinfo -*-
@deftypefn {} {} char (@var{x})
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?56419>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/