guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FEATURE REQUEST] Add a hook to print warning message prefix string


From: Nala Ginrut
Subject: [FEATURE REQUEST] Add a hook to print warning message prefix string
Date: Fri, 18 Mar 2016 15:38:28 +0800

Hi folks!
I'm hacking guile-lua-rebirth these days. It's expected to release a
workable version this year. Besides, I can use Artanis from
guile-lua-rebirth smoothly. So we may never call Artanis a Scheme
framework then. ;-)

Well, here's my problem.
When we call a function in Lua and it's needed to be compiled, there'll
be warning message start with ";;;" which is the comment syntax of
Scheme.
But it seems our Lua compiler doesn't like it:

=======================================log=========================================
;;; note: source file ./language/lua/stdlib/io.scm
;;;       newer than
compiled 
/home/nalaginrut/.cache/guile/ccache/2.2-LE-8-3.7/home/nalaginrut/Project/guile-lua-rebirth/language/lua/stdlib/io.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling ./language/lua/stdlib/io.scm
;;; WARNING: compilation of ./language/lua/stdlib/io.scm failed:
;;; ERROR: Syntax error:
;;; ./language/lua/stdlib/io.scm:1:1: Syntax error: unexpected token :
in form semi-colon
=======================================end==========================================

This problem won't cause any error, and Lua works fine. It's just ugly
and scare someone.

So my suggestion is that we add a helper function to customize the
warning message prefix string to make sure it's compatible for the
specific language frontend.

This feature is useful for our multi-lang plan in the future.

Say, for Lua, like this:

(set-warning-prefix! "---")
==============================start====================
--- note: source file ./language/lua/stdlib/io.scm
---       newer than
compiled 
/home/nalaginrut/.cache/guile/ccache/2.2-LE-8-3.7/home/nalaginrut/Project/guile-lua-rebirth/language/lua/stdlib/io.scm.go
--- note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
---       or pass the --no-auto-compile argument to disable.
--- compiling ./language/lua/stdlib/io.scm
===============================end=====================

What do you think?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]