Article View: comp.lang.prolog
Article #660single_var_warnings
From: Dr D Stott Parker
Date: Wed, 19 Aug 1992 18:15
Date: Wed, 19 Aug 1992 18:15
38 lines
1659 bytes
1659 bytes
Regarding singleton variable warnings in SICStus Prolog,
there is actually a flag that can be used to suppress them:
(44) > sicstus0.7
SICStus 0.7 #1: Fri Oct 25 09:12:35 PDT 1991
| ?- prolog_flag(single_var_warnings,X,X).
X = on ?
yes
| ?- [user].
| test(X).
{Warning: [X] - singleton variables in test/1 in lines 10-11}
| {user consulted, 0 msec 340 bytes}
yes
| ?- prolog_flag(single_var_warnings,_,off).
yes
| ?- [user].
| test(X).
| {user consulted, 0 msec 48 bytes}
yes
| ?-
However, I think most Prolog programmers would strongly recommend leaving
it on. A very large percentage of typing and simple logic errors in
Prolog programs are detected with these warnings; one will usually
save time by following the single-variable style discipline.
D. Stott Parker (stott@cs.ucla.edu) UCLA Computer Science Dept.
+1 (213) 825-6871, 825-1322 secy. 3532 Boelter Hall
+1 (213) 825-2273 FAX Los Angeles, CA 90024-1596 USA
--
D. Stott Parker (stott@cs.ucla.edu) UCLA Computer Science Dept.
+1 (213) 825-6871, 825-1322 secy. 3532 Boelter Hall
+1 (213) 825-2273 FAX Los Angeles, CA 90024-1596 USA
Technical Details
Message-ID:
<1992Aug19.181551.14419@cs.ucla.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!mips!swrinde!elroy.jpl.nasa.gov!ucla-cs!bop.cs.ucla.edu!stottShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!mips!swrinde!elroy.jpl.nasa.gov!ucla-cs!bop.cs.ucla.edu!stott From: stott@bop.cs.ucla.edu (Dr D Stott Parker) Newsgroups: comp.lang.prolog Subject: single_var_warnings Message-ID: <1992Aug19.181551.14419@cs.ucla.edu> Date: 19 Aug 92 18:15:51 GMT Sender: usenet@cs.ucla.edu (Mr Usenet) Organization: University of California, Los Angeles Lines: 38 Nntp-Posting-Host: bop.cs.ucla.edu