[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sbcl-help
Subject:    Re: [Sbcl-help] not inlined because not saved?
From:       Will Senn <will.senn () gmail ! com>
Date:       2017-03-19 17:13:45
Message-ID: c2f003c2-fa65-56de-1000-0b0588d1bf0b () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


That makes sense. I was too busy trying to think about how to get my
function to where I could step through it to see the silliness of
recursive inlining.


On 3/19/17 12:11 PM, Stas Boukarev wrote:
> Well, it's a recursive function, it'll want to inline itself again.
>
> On Sun, Mar 19, 2017 at 8:06 PM, Will Senn <will.senn@gmail.com
> <mailto:will.senn@gmail.com>> wrote:
>
>     OK. I see the first two points, but why is inlining not good?
>
>
>     On 3/19/17 12:03 PM, Stas Boukarev wrote:
>>     Well, the warning actually gives you directions for inlining.
>>     And it doesn't complain after recompiling because it complains
>>     only once.
>>     And inlining a recursive function will end badly.
>>
>>     On Sun, Mar 19, 2017 at 7:51 PM, Will Senn <will.senn@gmail.com
>>     <mailto:will.senn@gmail.com>> wrote:
>>
>>         Hi,
>>
>>         How do I save a function so that it doesn't generate a
>>         warning about the
>>         function not being inlined because it hasn't been saved?
>>
>>         on first entering SBCL:
>>
>>         (defun sum (n1 n2)
>>           (declare (inline sum))
>>           (declare (optimize (debug 3)))
>>           (if (zerop n1) n2
>>               (sum (1- n1) (1+ n2))))
>>
>>         ;
>>         ; caught STYLE-WARNING:
>>         ;   Call to COMMON-LISP-USER::SUM could not be inlined
>>         because its
>>         source code was
>>         ;   not saved. A global INLINE or SB-EXT:MAYBE-INLINE
>>         proclamation must
>>         be in
>>         ;   effect to save function definitions for inlining.
>>         ;
>>         ; compilation unit finished
>>         ;   caught 1 STYLE-WARNING condition
>>
>>         SUM
>>
>>         on redefinition of sum, it doens't complain about not being about
>>         inlining, why?
>>
>>         Thanks,
>>
>>         Will
>>
>>         --
>>         GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3
>>         21E5 671F
>>
>>
>>         ------------------------------------------------------------------------------
>>         Check out the vibrant tech community on one of the world's most
>>         engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>         _______________________________________________
>>         Sbcl-help mailing list
>>         Sbcl-help@lists.sourceforge.net
>>         <mailto:Sbcl-help@lists.sourceforge.net>
>>         https://lists.sourceforge.net/lists/listinfo/sbcl-help
>>         <https://lists.sourceforge.net/lists/listinfo/sbcl-help>
>>
>>
>>
>>
>>     -- 
>>     With best regards, Stas.
>
>     -- 
>     GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 671F
>
>
>
>
> -- 
> With best regards, Stas.

-- 
GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 671F


[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>That makes sense. I was too busy trying to think about how to get
      my function to where I could step through it to see the silliness
      of recursive inlining.<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 3/19/17 12:11 PM, Stas Boukarev
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAF63=11ERXwJNzpc2Y=51UrGM8nrytBJz1A-H_uFb6SmokrNdA@mail.gmail.com"
      type="cite">
      <div dir="ltr">Well, it's a recursive function, it'll want to
        inline itself again.</div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Sun, Mar 19, 2017 at 8:06 PM, Will
          Senn <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:will.senn@gmail.com" \
target="_blank">will.senn@gmail.com</a>&gt;</span>  wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000">
              <p>OK. I see the first two points, but why is inlining not
                good?<br>
              </p>
              <div>
                <div class="h5"> <br>
                  <div class="m_7877405797960663804moz-cite-prefix">On
                    3/19/17 12:03 PM, Stas Boukarev wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">Well, the warning actually gives you
                      directions for inlining.
                      <div>And it doesn't complain after recompiling
                        because it complains only once.</div>
                      <div>And inlining a recursive function will end
                        badly.</div>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">On Sun, Mar 19, 2017 at
                        7:51 PM, Will Senn <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:will.senn@gmail.com"
                            target="_blank">will.senn@gmail.com</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">Hi,<br>
                          <br>
                          How do I save a function so that it doesn't
                          generate a warning about the<br>
                          function not being inlined because it hasn't
                          been saved?<br>
                          <br>
                          on first entering SBCL:<br>
                          <br>
                          (defun sum (n1 n2)<br>
                            (declare (inline sum))<br>
                            (declare (optimize (debug 3)))<br>
                            (if (zerop n1) n2<br>
                                (sum (1- n1) (1+ n2))))<br>
                          <br>
                          ;<br>
                          ; caught STYLE-WARNING:<br>
                          ;   Call to COMMON-LISP-USER::SUM could not be
                          inlined because its<br>
                          source code was<br>
                          ;   not saved. A global INLINE or
                          SB-EXT:MAYBE-INLINE proclamation must<br>
                          be in<br>
                          ;   effect to save function definitions for
                          inlining.<br>
                          ;<br>
                          ; compilation unit finished<br>
                          ;   caught 1 STYLE-WARNING condition<br>
                          <br>
                          SUM<br>
                          <br>
                          on redefinition of sum, it doens't complain
                          about not being about<br>
                          inlining, why?<br>
                          <br>
                          Thanks,<br>
                          <br>
                          Will<br>
                          <span class="m_7877405797960663804HOEnZb"><font
                              color="#888888"><br>
                              --<br>
                              GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D 
                              CC0D 21CB 91B3 21E5 671F<br>
                              <br>
                              <br>
                              \
------------------------------<wbr>------------------------------<wbr>------------------<br>
  Check out the vibrant tech community on
                              one of the world's most<br>
                              engaging tech sites, Slashdot.org! <a
                                moz-do-not-send="true"
                                href="http://sdm.link/slashdot"
                                rel="noreferrer" \
                target="_blank">http://sdm.link/slashdot</a><br>
                              \
______________________________<wbr>_________________<br>  Sbcl-help mailing list<br>
                              <a moz-do-not-send="true"
                                href="mailto:Sbcl-help@lists.sourceforge.net"
                                \
target="_blank">Sbcl-help@lists.sourceforge.ne<wbr>t</a><br>  <a \
                moz-do-not-send="true"
                                \
                href="https://lists.sourceforge.net/lists/listinfo/sbcl-help"
                                rel="noreferrer" \
target="_blank">https://lists.sourceforge.net/<wbr>lists/listinfo/sbcl-help</a><br>  \
</font></span></blockquote>  </div>
                      <br>
                      <br clear="all">
                      <div><br>
                      </div>
                      -- <br>
                      <div class="m_7877405797960663804gmail_signature"
                        data-smartmail="gmail_signature">With best
                        regards, Stas.</div>
                    </div>
                  </blockquote>
                  <br>
                  <pre class="m_7877405797960663804moz-signature" cols="72">-- 
GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 671F</pre>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature" data-smartmail="gmail_signature">With
          best regards, Stas.</div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
GPG Fingerprint: 208A 38D6 D1BF 5A6B 7F4D  CC0D 21CB 91B3 21E5 671F</pre>
  </body>
</html>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

_______________________________________________
Sbcl-help mailing list
Sbcl-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sbcl-help


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic