From 0abbda4a698bc0f3eb531c6578469c3dff65ad57 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 4 Aug 2015 08:41:58 -0700 Subject: * eval.c (force): Default the new second argument of source_loc_str. (eval_error): Derive location of error from the last_form_evaled, if form doesn't have it. (eval_init): Re-register source-loc-str as binary with an optional arg. * match.c (debuglf, sem_error, file_err, typed_error): Default new argument of source_loc_str. * parser.h (source_loc_str): Declaration updated. * parser.l (source_loc_str): Take second argument which specifies alternative value if the source loc info is not found. * unwind.c (uw_throw): Simplify code thanks to source_loc_str default argument. * txr.1: Document new argument of source-loc-str. --- txr.1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 19984c25..cefd833e 100644 --- a/txr.1 +++ b/txr.1 @@ -30985,7 +30985,7 @@ one specifies the result of .coNP Functions @ source-loc and @ source-loc-str .synb .mets (source-loc << form ) -.mets (source-loc-str << form ) +.mets (source-loc-str << form <> [ alternative ]) .syne .desc These functions map an expression in a \*(TX program to the file name and @@ -31009,9 +31009,14 @@ is not a piece of the program source code that was constructed by the .code source-loc returns .codn nil , -and +and, in the absence of the +.meta alternative +argument, .code source-loc-str -returns a string whose text says that source location is not available. +returns a string whose text says that source location is not available, +otherwise it returns the +.meta alternative +argument. .coNP Function @ rlcp .synb -- cgit v1.2.3