Re: [Chicken-hackers] [PATCH] Use vertical space more liberally in some scrutinizer messages

2019-01-12 Thread megane

Evan Hanson  writes:

> On 2019-01-10 18:12, megane wrote:
>> Evan Hanson  writes:
[snip]
>> Do you agree with approach I took about gensym'd variables in the second
>> patch? If not, I think I'll have to come up with something else.
>
> That's a nice idea, I think it's probably fine. But if we're going to do
> that, why not wipe line numbers in all the expected files rather than
> just the new one?
>

Good idea.

>> diff --git a/tests/redact-gensyms.scm b/tests/redact-gensyms.scm
>> new file mode 100644
>> index 000..c6abb7b
>> --- /dev/null
>> +++ b/tests/redact-gensyms.scm
>> @@ -0,0 +1,25 @@
>> + (define prefixes (if (null? (command-line-arguments))
>> +'("tmp" "g")
>> +(string-split (car (command-line-arguments)) ",")))
>> +
>> + (let ((rege (irregex `(: ($ (or ,@prefixes)) (+ numeric)
>
> This regex could be `(: bow ($ (or ,@prefixes)) (+ numeric)) so you avoid
> accidentally replacing numbers in something like a variable called "dog1".
>

Didn't think of that, good catch.

Here's a modified patch that does these two things.

It occurred to me that perhaps redact-gensyms shouldn't use XXX as the
replacement as that's used in comments in the codebase. It could make
grepping for XXXs a bit painful.

>From 999b2534cff88a13f040a23b9e7bec1c1c8ca351 Mon Sep 17 00:00:00 2001
From: megane 
Date: Wed, 28 Nov 2018 17:28:03 +0200
Subject: [PATCH] tests/runtests.sh: Sanitize gensyms from scrutinizer outputs

Instead of skipping tests that are sensitive to gensyms altogether try
to sanitize the output.

For scrutinizer-message-format.scm, sanitize a and b because they are
used in typevars. These are removed once the scrutinizer sanitizes
typevars in messages internally again (fix for #1563 broke this).

Also, sanitize "scm:" so line number mismatches do not cause million
diff conflicts when adding/removing stuff to/from tests.

* tests/redact-gensyms.scm: New small program to replace numbers from
  common gensym prefixes

* [tests] runtests.sh: compile, use redact-gensyms
---
 distribution/manifest |   1 +
 tests/redact-gensyms.scm  |  25 +++
 tests/runtests.sh |  31 +++-
 tests/scrutinizer-message-format.expected |  42 ++-
 tests/scrutiny-2.expected |  46 ++--
 tests/scrutiny.expected   | 118 +++---
 tests/specialization.expected |  18 +++--
 7 files changed, 154 insertions(+), 127 deletions(-)
 create mode 100644 tests/redact-gensyms.scm

diff --git a/distribution/manifest b/distribution/manifest
index c1a615e..928d5ef 100644
--- a/distribution/manifest
+++ b/distribution/manifest
@@ -176,6 +176,7 @@ tests/scrutiny-tests-2.scm
 tests/scrutiny-tests-3.scm
 tests/scrutiny.expected
 tests/scrutiny-2.expected
+tests/redact-gensyms.scm
 tests/test-scrutinizer-message-format.scm
 tests/scrutinizer-message-format.expected
 tests/syntax-rule-stress-test.scm
diff --git a/tests/redact-gensyms.scm b/tests/redact-gensyms.scm
new file mode 100644
index 000..31ca8a2
--- /dev/null
+++ b/tests/redact-gensyms.scm
@@ -0,0 +1,25 @@
+(module
+ redact-gensyms
+ ()
+ (import scheme)
+ (import (chicken base))
+ (import (chicken irregex))
+ (import (chicken type))
+ (import (only (chicken io) read-line)
+(only (chicken process-context) command-line-arguments)
+(only (chicken string) string-split))
+
+ (define prefixes (if (null? (command-line-arguments))
+ '("tmp" "g" "scm:")
+   (string-split (car (command-line-arguments)) ",")))
+
+ (let ((rege (irregex `(: bow ($ (or ,@prefixes)) (+ numeric)
+   (print ";; numbers replaced with XXX by redact-gensyms.scm")
+   (print ";; prefixes: " prefixes)
+   (let lp ()
+ (let ((l (read-line)))
+   (if (not (eof-object? l))
+  (begin
+(print (irregex-replace/all rege l 1 "XXX"))
+(lp))
+ )
diff --git a/tests/runtests.sh b/tests/runtests.sh
index c6f9252..7b067b7 100755
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -114,28 +114,21 @@ $compile typematch-tests.scm -specialize -no-warnings
 
 $compile scrutiny-tests.scm -analyze-only -verbose 2>scrutiny.out
 $compile specialization-tests.scm -analyze-only -verbose -specialize 
2>specialization.out
-
-# these are sensitive to gensym-names, so make them optional
-if test \! -f scrutiny.expected; then
-cp scrutiny.expected scrutiny.out
-fi
-if test \! -f specialization.expected; then
-cp specialization.expected specialization.out
-fi
-
 $compile scrutiny-tests-2.scm -A -verbose 2>scrutiny-2.out
 $compile test-scrutinizer-message-format.scm -A -verbose 
2>scrutinizer-message-format.out || true
 
-diff $DIFF_OPTS scrutinizer-message-format.expected 
scrutinizer-message-format.out
-diff $DIFF_OPTS scrutiny.expected scrutiny.out
-diff $DIFF_OPTS specialization.expected specialization.out
-
-# this is sensitive to gensym-names, 

Re: [Chicken-hackers] [PATCH] Get rid of special encoding for qualified symbols (fixes #1077)

2019-01-12 Thread Peter Bex
On Wed, Jan 09, 2019 at 05:06:00PM +0100, felix.winkelm...@bevuta.com wrote:
> > If everyone is okay with this, I can try to find some time to do it
> > this weekend.
> 
> Sounds good. Attached are the signed-off patches.

Thanks, I've published the snapshot and updated the bootstrap.sh script.

Cheers,
Peter


signature.asc
Description: PGP signature
___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers


Re: [Chicken-hackers] read/write invariance of #!

2019-01-12 Thread Jim Ursetto

> On Jan 11, 2019, at 9:47 PM, Jim Ursetto  wrote:
> 
>> On Jan 11, 2019, at 3:12 PM, Evan Hanson > > wrote:
>> 
>> In case someone decides to apply this patch, there's an unnecessary (and ...)
>> around the conditional that can be removed.
> 
> Hi Evan,
> Sorry for the delay. I happened to be testing this out earlier today—it 
> appears to be fine, applied to HEAD from today. (With the and clause intact.)


Looks like I tested this with core from a few days ago, prior to #1077 being 
applied, which touched the same code. Therefore the patch needs to be updated 
slightly. Unfortunately it missed 5.0.1. :(

Jim___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers


Re: [Chicken-hackers] [PATCH] Get rid of special encoding for qualified symbols (fixes #1077)

2019-01-12 Thread felix . winkelmann
> On Wed, Jan 09, 2019 at 05:06:00PM +0100, felix.winkelm...@bevuta.com wrote:
> > > If everyone is okay with this, I can try to find some time to do it
> > > this weekend.
> > 
> > Sounds good. Attached are the signed-off patches.
> 
> Thanks, I've published the snapshot and updated the bootstrap.sh script.

I think the bootstrap-script is still the same.


felix


___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers


Re: [Chicken-hackers] [PATCH] Get rid of special encoding for qualified symbols (fixes #1077)

2019-01-12 Thread Peter Bex
On Sat, Jan 12, 2019 at 08:11:51PM +0100, felix.winkelm...@bevuta.com wrote:
> > On Wed, Jan 09, 2019 at 05:06:00PM +0100, felix.winkelm...@bevuta.com wrote:
> > > > If everyone is okay with this, I can try to find some time to do it
> > > > this weekend.
> > >
> > > Sounds good. Attached are the signed-off patches.
> >
> > Thanks, I've published the snapshot and updated the bootstrap.sh script.
> 
> I think the bootstrap-script is still the same.

Right you are.  I just forgot to push, but I've fixed that now.
Thanks for pointing it out!

Cheers,
Peter


signature.asc
Description: PGP signature
___
Chicken-hackers mailing list
Chicken-hackers@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-hackers