unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* proposal: meaningful read error messages
@ 2002-07-29 12:24 Han-Wen Nienhuys
  2002-08-19  6:50 ` Dirk Herrmann
  0 siblings, 1 reply; 2+ messages in thread
From: Han-Wen Nienhuys @ 2002-07-29 12:24 UTC (permalink / raw)



Hello there:

I propose to install more meaningful error messages in scm_lreadr():
we could replace SCM_MISC_ERROR() by the following macro:

	#define INPUT_ERROR(port,message,arg) \
	{ char s[1024];\
	  char *fn = scm_string_p (SCM_FILENAME(port)) ? SCM_STRING_CHARS(SCM_FILENAME(port)) : ""; \
	  sprintf (s, "In %s:%ld:%d : %s", fn, SCM_LINUM(port), SCM_COL(port) + 1, message);\
	  SCM_MISC_ERROR(s, arg);\
	}\


any thoughts, comments? (Should this be switched off if
SCM_RECORD_POSITIONS_P is off?)


	meddo:/tmp$ echo -e "\n\n  )" > foo.scm
	meddo:/tmp$ ~/usr/bin/guile -s foo.scm
	Unexpected ")" in line 2, col 2
	ERROR: In procedure scm_lreadr:
	ERROR: unexpected ")"
	meddo:/tmp$ /usr/bin/guile -s foo.scm
	ERROR: In procedure read:
	ERROR: unexpected ")"


-- 

Han-Wen Nienhuys   |   hanwen@cs.uu.nl    | http://www.cs.uu.nl/~hanwen/


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: proposal: meaningful read error messages
  2002-07-29 12:24 proposal: meaningful read error messages Han-Wen Nienhuys
@ 2002-08-19  6:50 ` Dirk Herrmann
  0 siblings, 0 replies; 2+ messages in thread
From: Dirk Herrmann @ 2002-08-19  6:50 UTC (permalink / raw)
  Cc: guile-devel

On Mon, 29 Jul 2002, Han-Wen Nienhuys wrote:

> I propose to install more meaningful error messages in scm_lreadr():
> we could replace SCM_MISC_ERROR() by the following macro:
> 
> 	#define INPUT_ERROR(port,message,arg) \
> 	{ char s[1024];\
> 	  char *fn = scm_string_p (SCM_FILENAME(port)) ? SCM_STRING_CHARS(SCM_FILENAME(port)) : ""; \
> 	  sprintf (s, "In %s:%ld:%d : %s", fn, SCM_LINUM(port), SCM_COL(port) + 1, message);\
> 	  SCM_MISC_ERROR(s, arg);\
> 	}\
> 
> 
> any thoughts, comments? (Should this be switched off if
> SCM_RECORD_POSITIONS_P is off?)

I like better error messages.  However, I would suggest to use a function
instead of a macro.  Performance is not a problem when it comes to
handling errors.

Best regards,
Dirk



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-08-19  6:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-29 12:24 proposal: meaningful read error messages Han-Wen Nienhuys
2002-08-19  6:50 ` Dirk Herrmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).