emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#15533: closed (optimizing away noticeable effects)


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#15533: closed (optimizing away noticeable effects)
Date: Tue, 07 Jan 2014 04:39:02 +0000

Your message dated Tue, 07 Jan 2014 04:38:39 +0000
with message-id <address@hidden>
and subject line Re: bug#15533: optimizing away noticeable effects
has caused the debbugs.gnu.org bug report #15533,
regarding optimizing away noticeable effects
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
15533: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15533
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: optimizing away noticeable effects Date: Sat, 05 Oct 2013 20:27:55 +0100 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
I was peeved today to come across a bug that manifested itself when I
removed a pk from a particular value in my code.

Time to play "spot the difference"

scheme@(guile-user)> ,optimize (define (foo f arg)
  (let* ((l '())
         (m (if (pair? arg)
                (begin
                  (set! l (cdr arg))
                  (car arg))
                arg)))
    (lambda () (apply f m l))))
$14 = (define (foo f arg)
  (let ((m (if (pair? arg)
             (begin (begin (cdr arg) (if #f #f)) (car arg))
             arg)))
    (lambda () (f m))))

scheme@(guile-user)> ,optimize (define (foo2 f arg)
  (let* ((l '())
         (m (if (pair? arg)
                (begin
                  (set! l (cdr arg))
                  (car arg))
                arg)))
    (lambda () (apply f m (pk l)))))
$15 = (define (foo2 f arg)
  (let* ((l '())
         (m (if (pair? arg)
              (begin (set! l (cdr arg)) (car arg))
              arg)))
    (lambda () (apply f m (pk l)))))

and if you actually define those procedures and run them

scheme@(guile-user)> ((foo list '(a b c)))
$16 = (a)
scheme@(guile-user)> ((foo2 list '(a b c)))

;;; ((b c))
$17 = (a b c)

I'm currently on the lua branch, which means branches from master at
6871327742d3e1a0966aa8fed04c911311c12c2a (Aug 31). I'll try on a more
recent master or stable when I have time.

-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"




--- End Message ---
--- Begin Message --- Subject: Re: bug#15533: optimizing away noticeable effects Date: Tue, 07 Jan 2014 04:38:39 +0000 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
Following prompting from mark weaver on IRC. I rebased this patch, and
pushed to stable-2.0.

-- 
Ian Price -- shift-reset.com

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"


--- End Message ---

reply via email to

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