Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Always look over your shoulder because everyone is watching and plotting against you.


devel / comp.lang.lisp / NOTINLINE

SubjectAuthor
* NOTINLINESpiros Bousbouras
+* Re: NOTINLINEJeff Barnett
|`* Re: NOTINLINESpiros Bousbouras
| `* Re: NOTINLINEJeff Barnett
|  `- Re: NOTINLINESpiros Bousbouras
+- Re: NOTINLINEHelmut Eller
+- Re: NOTINLINEZyni Moë
`* Re: NOTINLINESteve G
 +* Re: NOTINLINESpiros Bousbouras
 |`- Re: NOTINLINEsteve
 `* Re: NOTINLINEZyni Moë
  `* Re: NOTINLINEsteve gonedes
   +* Re: NOTINLINEZyni Moë
   |`* Re: NOTINLINE
   | `- Re: NOTINLINESteve G
   `* Re: NOTINLINETom Russ
    +- Re: NOTINLINEZyni Moë
    `- Re: NOTINLINE

1
NOTINLINE

<2Z=vsGJa+iZYf2EtP@bongo-ra.co>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17010&group=comp.lang.lisp#17010

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!wMjcvFyyQbKkD1DyxkS8fQ.user.46.165.242.91.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: NOTINLINE
Date: Fri, 1 Apr 2022 16:21:10 -0000 (UTC)
Organization: Aioe.org NNTP Server
Message-ID: <2Z=vsGJa+iZYf2EtP@bongo-ra.co>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="60091"; posting-host="wMjcvFyyQbKkD1DyxkS8fQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
 by: Spiros Bousbouras - Fri, 1 Apr 2022 16:21 UTC

The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ? Are there
some things which are guaranteed to work if a function has been declared
NOTINLINE but may or may not work otherwise ? For example , assuming no
declarations for the following functions , is the following guaranteed to
work as appears in the output below ?

==============
* (defun foo1 () 'foo1)

FOO1
* (defun foo2 () 'foo2)

FOO2
* (defun foo3 () 'foo3)

FOO3
* (foo3)

FOO3
* (setf (symbol-function 'foo3) (function foo1))

#<FUNCTION FOO1>
* (foo3)

FOO1
* (setf (symbol-function 'foo3) (function foo2))

#<FUNCTION FOO2>
* (foo3)

FOO2
==============

Might any declarations of INLINE affect the output ?

--
To some it is Napoleon, to some it is a philosophical struggle, to me it is
allegro con brio.
Arturo Toscanini
http://www.beethovenseroica.com/Pg3_anal/analmenu.htm

Re: NOTINLINE

<t28dku$b8g$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17013&group=comp.lang.lisp#17013

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Fri, 1 Apr 2022 20:50:01 -0600
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <t28dku$b8g$1@dont-email.me>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 2 Apr 2022 02:50:06 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="499733bd091aa54d4098323a2afed582";
logging-data="11536"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WTeAg4OT5SuavGP8G6KLtZWyxw9UQVV4="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:kjewt3SLYQ2/3o2hfpLJDN0nxcQ=
In-Reply-To: <2Z=vsGJa+iZYf2EtP@bongo-ra.co>
Content-Language: en-US
 by: Jeff Barnett - Sat, 2 Apr 2022 02:50 UTC

On 4/1/2022 10:21 AM, Spiros Bousbouras wrote:
> The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
> ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ? Are there
> some things which are guaranteed to work if a function has been declared
> NOTINLINE but may or may not work otherwise ? For example , assuming no
> declarations for the following functions , is the following guaranteed to
> work as appears in the output below ?

Consider a recursive function ....
--
Jeff Barnett

Re: NOTINLINE

<PL8UCWsdMrOcp1n5G@bongo-ra.co>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17014&group=comp.lang.lisp#17014

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Sat, 2 Apr 2022 03:37:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 18
Message-ID: <PL8UCWsdMrOcp1n5G@bongo-ra.co>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <t28dku$b8g$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 2 Apr 2022 03:37:57 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="acf09b3ebf99ef89486c695378ce4230";
logging-data="16236"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+dWJhL+LdYvs7mznYBl3Vh"
Cancel-Lock: sha1:7ATe4iobR5fg6dWDRQprG45mFHI=
In-Reply-To: <t28dku$b8g$1@dont-email.me>
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
 by: Spiros Bousbouras - Sat, 2 Apr 2022 03:37 UTC

On Fri, 1 Apr 2022 20:50:01 -0600
Jeff Barnett <jbb@notatt.com> wrote:
> On 4/1/2022 10:21 AM, Spiros Bousbouras wrote:
> > The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
> > ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ? Are there
> > some things which are guaranteed to work if a function has been declared
> > NOTINLINE but may or may not work otherwise ? For example , assuming no
> > declarations for the following functions , is the following guaranteed to
> > work as appears in the output below ?
>
> Consider a recursive function ....

I don't see how a recursive function explains why NOTINLINE cannot be
ignored. It gives one explanation as to why INLINE can be ignored but this
wasn't the gist of my question. Recursive functions aside , INLINE can be
ignored simply to remove the burden from the compiler writers to add any
optimisations for it. It's the same reason why inline declarations can be
ignored in C .

Re: NOTINLINE

<t28k7d$iub$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17015&group=comp.lang.lisp#17015

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jbb@notatt.com (Jeff Barnett)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Fri, 1 Apr 2022 22:42:15 -0600
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <t28k7d$iub$1@dont-email.me>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <t28dku$b8g$1@dont-email.me>
<PL8UCWsdMrOcp1n5G@bongo-ra.co>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 2 Apr 2022 04:42:21 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="499733bd091aa54d4098323a2afed582";
logging-data="19403"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OuI4TFe7TgsGDm1vaAJvyGJwlQ6u+5m8="
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.7.0
Cancel-Lock: sha1:YneW40X8dRua3otgPCThMQfO63g=
In-Reply-To: <PL8UCWsdMrOcp1n5G@bongo-ra.co>
Content-Language: en-US
 by: Jeff Barnett - Sat, 2 Apr 2022 04:42 UTC

On 4/1/2022 9:37 PM, Spiros Bousbouras wrote:
> On Fri, 1 Apr 2022 20:50:01 -0600
> Jeff Barnett <jbb@notatt.com> wrote:
>> On 4/1/2022 10:21 AM, Spiros Bousbouras wrote:
>>> The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
>>> ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ? Are there
>>> some things which are guaranteed to work if a function has been declared
>>> NOTINLINE but may or may not work otherwise ? For example , assuming no
>>> declarations for the following functions , is the following guaranteed to
>>> work as appears in the output below ?
>>
>> Consider a recursive function ....
>
> I don't see how a recursive function explains why NOTINLINE cannot be
> ignored. It gives one explanation as to why INLINE can be ignored but this
> wasn't the gist of my question. Recursive functions aside , INLINE can be
> ignored simply to remove the burden from the compiler writers to add any
> optimisations for it. It's the same reason why inline declarations can be
> ignored in C .

If the compiler is not allowed to ignore a NOTINLINE that you have
proclaimed (or whatever) for a recursive function, how many expansions
should the compiler do before giving up and signalling an error or must
it wait until either disk, memory, or address space has been exhausted?

There are also many ways that an innocent short looking function can
expand into a huge number of operations - inline expansion of functions
it applies (to many levels), macro usages that make make a lot out of a
little, and so on. Etc.

I will say on further reflection that this appears to be one of the few
places that the spec tries to keep system implementers from shooting
themselves (and their users) in the foot. Doesn't sound all that Lisp
like does it?
--
Jeff Barnett

Re: NOTINLINE

<m2h77b4y8w.fsf@gmail.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17016&group=comp.lang.lisp#17016

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!aioe.org!aNCMBMWIQGTvIq0P+KkXPg.user.46.165.242.91.POSTED!not-for-mail
From: eller.helmut@gmail.com (Helmut Eller)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Sat, 02 Apr 2022 11:42:55 +0200
Organization: Aioe.org NNTP Server
Message-ID: <m2h77b4y8w.fsf@gmail.com>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: gioia.aioe.org; logging-data="58706"; posting-host="aNCMBMWIQGTvIq0P+KkXPg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
X-Notice: Filtered by postfilter v. 0.9.2
Cancel-Lock: sha1:XZ02lKdhiGyL8IOmaJeOMzufmMw=
 by: Helmut Eller - Sat, 2 Apr 2022 09:42 UTC

On Fri, Apr 01 2022, Spiros Bousbouras wrote:

> The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
> ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ? Are there
> some things which are guaranteed to work if a function has been declared
> NOTINLINE but may or may not work otherwise ?

This may have something to do with file compilation. I think a CL
compiler is allowed to inline calls to (global) functions defined within
the same file. The NOTINLINE declaration could be used to enforce
certain indirections. E.g., it may be useful when you want to redefine
a function.

Helmut

Re: NOTINLINE

<t29bgk$7r0$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17018&group=comp.lang.lisp#17018

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no_email@invalid.invalid (Zyni Moë)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Sat, 2 Apr 2022 11:19:48 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <t29bgk$7r0$1@dont-email.me>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 2 Apr 2022 11:19:48 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="2b754b687152754e0ef997afac10a0b7";
logging-data="8032"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+KwemTpEd30brhjds/rfJj5nnxsLhHxgo="
User-Agent: NewsTap/5.5 (iPad)
Cancel-Lock: sha1:Pn1fRRahYM+V+YhU1UJ+AJChmso=
sha1:3a4FU7iMUdzzVZjDkh446MR2KhU=
 by: Zyni Moë - Sat, 2 Apr 2022 11:19 UTC

Spiros Bousbouras <spibou@gmail.com> wrote:
> The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
> ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ? Are there
> some things which are guaranteed to work if a function has been declared
> NOTINLINE but may or may not work otherwise ?

Yes. As one example if you wish to memoize a function is generally
necessary that recursive calls to it, including tail calls, are not
optimized away: they must be full calls which look up the symbol-function
and call the function they find there, because it is that function which is
doing the memoizing.

Consider this:

(defun obvious-fibonacci (n)
... two self-calls to obvious-fibonacci ...)

Compiler 'optimizes' these self-calls, obvious-fibonacci is now exponential
time. Now we do (memoize 'obvious-fibonacci). Oh dear, is still
exponential because only one call (at most) is ever memoized. Instead do

(declaim (notinline obvious-fibonacci))
(defun obvious-fibonacci ...)
(memoize 'obvious-fibonacci)

And now obvious-fibonacci is fast.

--
the small snake

Re: NOTINLINE

<PZdctoJa+Eg85L5q7@bongo-ra.co>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17019&group=comp.lang.lisp#17019

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.cyber23.de!.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Sat, 2 Apr 2022 15:47:38 -0000 (UTC)
Organization: Cyber23 news
Message-ID: <PZdctoJa+Eg85L5q7@bongo-ra.co>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <t28dku$b8g$1@dont-email.me> <PL8UCWsdMrOcp1n5G@bongo-ra.co>
<t28k7d$iub$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 2 Apr 2022 15:47:38 -0000 (UTC)
Injection-Info: news.cyber23.de;
logging-data="36480"; mail-complaints-to="abuse@cyber23.de"
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
In-Reply-To: <t28k7d$iub$1@dont-email.me>
 by: Spiros Bousbouras - Sat, 2 Apr 2022 15:47 UTC

On Fri, 1 Apr 2022 22:42:15 -0600
Jeff Barnett <jbb@notatt.com> wrote:
> On 4/1/2022 9:37 PM, Spiros Bousbouras wrote:
> > On Fri, 1 Apr 2022 20:50:01 -0600
> > Jeff Barnett <jbb@notatt.com> wrote:
> >> On 4/1/2022 10:21 AM, Spiros Bousbouras wrote:
> >>> The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
> >>> ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ? Are there
> >>> some things which are guaranteed to work if a function has been declared
> >>> NOTINLINE but may or may not work otherwise ? For example , assuming no
> >>> declarations for the following functions , is the following guaranteed to
> >>> work as appears in the output below ?
> >>
> >> Consider a recursive function ....
> >
> > I don't see how a recursive function explains why NOTINLINE cannot be
> > ignored. It gives one explanation as to why INLINE can be ignored but this
> > wasn't the gist of my question. Recursive functions aside , INLINE can be
> > ignored simply to remove the burden from the compiler writers to add any
> > optimisations for it. It's the same reason why inline declarations can be
> > ignored in C .
>
> If the compiler is not allowed to ignore a NOTINLINE that you have
> proclaimed (or whatever) for a recursive function, how many expansions
> should the compiler do before giving up and signalling an error or must
> it wait until either disk, memory, or address space has been exhausted?

Not even 1 expansion because it would be pointless. That's a quality of
implementation issue and has nothing to do with any NOTINLINE declaration.
Even if a function has been declared INLINE , a compiler is still not allowed
to fail to compile it because it entered into an infinite recursion by trying
to expand it inline. And it's actually easy to detect that a function
directly calls itself ; if the call is not direct then inline expansion is
not relevant anyway.

> There are also many ways that an innocent short looking function can
> expand into a huge number of operations - inline expansion of functions
> it applies (to many levels), macro usages that make make a lot out of a
> little, and so on. Etc.

So if the programmer believes that a function will be called in many places ,
he declares the function NOTINLINE to reduce the size of the generated code.
This seems like a valid reason. It also raises the question whether , in the
absence of any [NOT]INLINE declarations , the compiler is allowed to expand
[some] calls to the function inline.

> I will say on further reflection that this appears to be one of the few
> places that the spec tries to keep system implementers from shooting
> themselves (and their users) in the foot. Doesn't sound all that Lisp
> like does it?

I don't think it's about users not shooting themselves in the foot. Declaring
a function NOTINLINE strikes me as a kind of esoteric thing to do so the
programmer must already have her reasons.

--
vlaho.ninja/prog

Re: NOTINLINE

<875ynq5k6h.fsf@l0ft.tpl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17021&group=comp.lang.lisp#17021

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 03 Apr 2022 09:14:24 -0500
From: Sgonedes1977@gmail.com (Steve G)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co>
Date: Sun, 03 Apr 2022 10:13:42 -0400
Message-ID: <875ynq5k6h.fsf@l0ft.tpl>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:GGJHVTV++QIqQyNRwnJFnN4S0EE=
MIME-Version: 1.0
Content-Type: text/plain
Lines: 122
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-s15t3fzTpM/cAQ8AkTrhWNDWIx8XR2Wc58nQ46EFSrEeB/08pZaCP1XiZrfASP10px609dMzGzalAuP!faJguavSrsHqI2AZwE9vPOmIoZAsdRsPbRxTrWBoBxccOfSD
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 4309
 by: Steve G - Sun, 3 Apr 2022 14:13 UTC

Spiros Bousbouras <spibou@gmail.com> writes:

> The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
> ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ?

It is a programming thing. I usually use it with interfaces so that if
the code changes any dependent software will not have to be recompiled.

Ex...

;;;; Termcap Interface
(declaim (notinline tgetstr tgetnum tgetstr))

(defun tgetflag (cap)
"Return value of termcap boolean capability <CAP>."
(declare (type simple-string cap))
(get-sequence cap))

(defun tgetnum (cap)
"Return value of boolean capability <CAP>."
(declare (type simple-string cap))
(get-sequence cap))

(defun tgetstr (cap)
"Return a string for capability <CAP>."
(declare (type simple-string cap))
(get-sequence cap))

If these functions where inlined then every time I recompile the file,
the entire program must be recompiled. This is similar to static
libraries vs. dynamic libraries. On unix that would be `.a' and `.so' .
On windows it would be a DLL.

I think most people can agree that static libraries can lead to some
very agrevating problems.

> Are there
> some things which are guaranteed to work if a function has been declared
> NOTINLINE but may or may not work otherwise ?

When debugging code :)

Seriousy, gcc has this problem like nothing else. When compiling with
GCC if you want to debug use -ggdb and an optimization of -Og.

This is a new feature - a very good one, like -fverbose-asm.

> declarations for the following functions , is the following guaranteed to
> work as appears in the output below ?
>
> ==============
> * (defun foo1 () 'foo1)
>
> FOO1
> * (defun foo2 () 'foo2)
>
> FOO2
> * (defun foo3 () 'foo3)
>
> FOO3
> * (foo3)
>
> FOO3
> * (setf (symbol-function 'foo3) (function foo1))

No. I believe you are misunderstanding symbol-function. Symbol-function
is like using the C preprocessor but at run time.

;;;; Globals and symbol-macros

(defstruct (screen (:copier nil) :named)
(namestring "Standard Screen" :type simple-string :read-only t)
;; [ ... ]

;; cursor position movement
(cur-x 0 :type (unsigned-byte 16))
(cur-y 0 :type (unsigned-byte 16))
(max-x 0 :type (unsigned-byte 16))
(max-y 0 :type (unsigned-byte 16)))

(defvar *current-screen* (make-screen)
"The current screen object.")

(defun current-screen ()
"Return the current screen object. This function is never called directly."
(the screen *current-screen*))

(define-symbol-macro *LINES* (screen-max-x (current-screen)))
;; "Number of rows for the current screen."

(define-symbol-macro *COLUMNS* (screen-max-y (current-screen)))
;; "Number of columns for the current screen."

The symbol-macro *COLUMNS* can be used like a global variable, but the
value is computed at runtime. Very cool feature.

> #<FUNCTION FOO1>
> * (foo3)
>
> FOO1
> * (setf (symbol-function 'foo3) (function foo2))
>
> #<FUNCTION FOO2>
> * (foo3)
>
> FOO2
> ==============
>
> Might any declarations of INLINE affect the output ?

When do you need the values? At runtime or compile time? I try not to
ever use global variables - I love the symbol-macro.

hope this helps some. if not please just ask away...

Re: NOTINLINE

<J+5xPt1AzfY4mR2Cc@bongo-ra.co>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17023&group=comp.lang.lisp#17023

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.cyber23.de!.POSTED!not-for-mail
From: spibou@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Sun, 3 Apr 2022 15:54:47 -0000 (UTC)
Organization: Cyber23 news
Message-ID: <J+5xPt1AzfY4mR2Cc@bongo-ra.co>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <875ynq5k6h.fsf@l0ft.tpl>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 3 Apr 2022 15:54:47 -0000 (UTC)
Injection-Info: news.cyber23.de;
logging-data="70220"; mail-complaints-to="abuse@cyber23.de"
X-Organisation: Weyland-Yutani
X-Server-Commands: nowebcancel
In-Reply-To: <875ynq5k6h.fsf@l0ft.tpl>
 by: Spiros Bousbouras - Sun, 3 Apr 2022 15:54 UTC

On Sun, 03 Apr 2022 10:13:42 -0400
Steve G <Sgonedes1977@gmail.com> wrote:
> Spiros Bousbouras <spibou@gmail.com> writes:
>
> > The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
> > ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ?
>
> It is a programming thing. I usually use it with interfaces so that if
> the code changes any dependent software will not have to be recompiled.

Ok , that makes sense.

> Ex...
>
> ;;;; Termcap Interface
> (declaim (notinline tgetstr tgetnum tgetstr))
>
> (defun tgetflag (cap)
> "Return value of termcap boolean capability <CAP>."
> (declare (type simple-string cap))
> (get-sequence cap))
>
> (defun tgetnum (cap)
> "Return value of boolean capability <CAP>."
> (declare (type simple-string cap))
> (get-sequence cap))
>
> (defun tgetstr (cap)
> "Return a string for capability <CAP>."
> (declare (type simple-string cap))
> (get-sequence cap))
>
>
> If these functions where inlined then every time I recompile the file,
> the entire program must be recompiled. This is similar to static
> libraries vs. dynamic libraries. On unix that would be `.a' and `.so' .
> On windows it would be a DLL.
>
> I think most people can agree that static libraries can lead to some
> very agrevating problems.
>
>
> > Are there
> > some things which are guaranteed to work if a function has been declared
> > NOTINLINE but may or may not work otherwise ?
>
> When debugging code :)
>
>
> Seriousy, gcc has this problem like nothing else. When compiling with
> GCC if you want to debug use -ggdb and an optimization of -Og.
>
> This is a new feature - a very good one, like -fverbose-asm.
>
>
> > declarations for the following functions , is the following guaranteed to
> > work as appears in the output below ?
> >
> > ==============
> > * (defun foo1 () 'foo1)
> >
> > FOO1
> > * (defun foo2 () 'foo2)
> >
> > FOO2
> > * (defun foo3 () 'foo3)
> >
> > FOO3
> > * (foo3)
> >
> > FOO3
> > * (setf (symbol-function 'foo3) (function foo1))
>
>
> No. I believe you are misunderstanding symbol-function. Symbol-function
> is like using the C preprocessor but at run time.
>
>
> ;;;; Globals and symbol-macros

The examples below are about symbol macros. But I asked about SYMBOL-FUNCTION
, a completely different thing.

> (defstruct (screen (:copier nil) :named)
> (namestring "Standard Screen" :type simple-string :read-only t)
> ;; [ ... ]
>
> ;; cursor position movement
> (cur-x 0 :type (unsigned-byte 16))
> (cur-y 0 :type (unsigned-byte 16))
> (max-x 0 :type (unsigned-byte 16))
> (max-y 0 :type (unsigned-byte 16)))
>
>
> (defvar *current-screen* (make-screen)
> "The current screen object.")
>
> (defun current-screen ()
> "Return the current screen object. This function is never called directly."
> (the screen *current-screen*))
>
> (define-symbol-macro *LINES* (screen-max-x (current-screen)))
> ;; "Number of rows for the current screen."
>
> (define-symbol-macro *COLUMNS* (screen-max-y (current-screen)))
> ;; "Number of columns for the current screen."
>
>
> The symbol-macro *COLUMNS* can be used like a global variable, but the
> value is computed at runtime. Very cool feature.
>
> > #<FUNCTION FOO1>
> > * (foo3)
> >
> > FOO1
> > * (setf (symbol-function 'foo3) (function foo2))
> >
> > #<FUNCTION FOO2>
> > * (foo3)
> >
> > FOO2
> > ==============
> >
> > Might any declarations of INLINE affect the output ?
>
> When do you need the values? At runtime or compile time? I try not to
> ever use global variables - I love the symbol-macro.

I don't have a specific usage in mind , I was just experimenting. But
lets say at runtime.

> hope this helps some. if not please just ask away...

Re: NOTINLINE

<t2cqoe$er1$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17024&group=comp.lang.lisp#17024

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no_email@invalid.invalid (Zyni Moë)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Sun, 3 Apr 2022 18:58:22 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <t2cqoe$er1$1@dont-email.me>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co>
<875ynq5k6h.fsf@l0ft.tpl>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 3 Apr 2022 18:58:22 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="e7bd2fdbadf2b87e37138ec5782fad10";
logging-data="15201"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19mOikl/Xsc+Kh9s3BuBRqEI7eg+oTGQ7o="
User-Agent: NewsTap/5.5 (iPad)
Cancel-Lock: sha1:nrxqnINePfFChj1PN6k4p7k7zAM=
sha1:tASc8Uurs15GpevmCYxEIPLMBcY=
 by: Zyni Moë - Sun, 3 Apr 2022 18:58 UTC

Steve G <Sgonedes1977@gmail.com> wrote:

> If these functions where inlined then every time I recompile the file,
> the entire program must be recompiled. This is similar to static
> libraries vs. dynamic libraries. On unix that would be `.a' and `.so' .
> On windows it would be a DLL.
>

Much more important, because it happens even when you do not explicitly
declare functions inline, are these two paragraphs from 3.2.2.3:

- Within a function named F, the compiler may (but is not required to)
assume that an apparent recursive call to a function named F refers to the
same definition of F, unless that function has been declared notinline. The
consequences of redefining such a recursively defined function F while it
is executing are undefined.

- A call within a file to a named function that is defined in the same file
refers to that function, unless that function has been declared notinline.
The consequences are unspecified if functions are redefined individually at
run time or multiply defined in the same file.

These two paragraphs explain why notinline cannot be ignored.

--
the small snake

Re: NOTINLINE

<ad7a9d4d-9cdb-4217-9ffa-cb4352242039n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17025&group=comp.lang.lisp#17025

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a05:622a:178a:b0:2e1:e7b8:e52e with SMTP id s10-20020a05622a178a00b002e1e7b8e52emr4578389qtk.464.1649188250279;
Tue, 05 Apr 2022 12:50:50 -0700 (PDT)
X-Received: by 2002:a05:6870:b021:b0:e1:dc43:9000 with SMTP id
y33-20020a056870b02100b000e1dc439000mr2296641oae.172.1649188250049; Tue, 05
Apr 2022 12:50:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Tue, 5 Apr 2022 12:50:49 -0700 (PDT)
In-Reply-To: <t2cqoe$er1$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=184.102.120.193; posting-account=J7s-KQoAAABxnJDbN-3ZlYayYdnHhWkr
NNTP-Posting-Host: 184.102.120.193
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <875ynq5k6h.fsf@l0ft.tpl> <t2cqoe$er1$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ad7a9d4d-9cdb-4217-9ffa-cb4352242039n@googlegroups.com>
Subject: Re: NOTINLINE
From: sgonedes1977@gmail.com (steve gonedes)
Injection-Date: Tue, 05 Apr 2022 19:50:50 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 42
 by: steve gonedes - Tue, 5 Apr 2022 19:50 UTC

On Sunday, April 3, 2022 at 2:58:27 PM UTC-4, Zyni Moë wrote:
> Steve G <Sgoned...@gmail.com> wrote:
>
> > If these functions where inlined then every time I recompile the file,
> > the entire program must be recompiled. This is similar to static
> > libraries vs. dynamic libraries. On unix that would be `.a' and `.so' .
> > On windows it would be a DLL.
> >
> Much more important, because it happens even when you do not explicitly
> declare functions inline, are these two paragraphs from 3.2.2.3:
>
>
> - Within a function named F, the compiler may (but is not required to)
> assume that an apparent recursive call to a function named F refers to the
> same definition of F, unless that function has been declared notinline. The
> consequences of redefining such a recursively defined function F while it
> is executing are undefined.
>

can you explain this mathematically or using pseudo-code?

> - A call within a file to a named function that is defined in the same file
> refers to that function, unless that function has been declared notinline..
> The consequences are unspecified if functions are redefined individually at
> run time or multiply defined in the same file.
>

A call within a file?


> --
> the small snake

Re: NOTINLINE

<K_6dnbvrP7FSA9H_nZ2dnUU7-XednZ2d@giganews.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17026&group=comp.lang.lisp#17026

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 05 Apr 2022 14:55:59 -0500
Subject: Re: NOTINLINE
Newsgroups: comp.lang.lisp
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <875ynq5k6h.fsf@l0ft.tpl>
<J+5xPt1AzfY4mR2Cc@bongo-ra.co>
From: loft@centurylink.net (steve)
Date: Tue, 5 Apr 2022 15:55:17 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Firefox/68.0 SeaMonkey/2.53.11.1
MIME-Version: 1.0
In-Reply-To: <J+5xPt1AzfY4mR2Cc@bongo-ra.co>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Message-ID: <K_6dnbvrP7FSA9H_nZ2dnUU7-XednZ2d@giganews.com>
Lines: 136
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-ZutFQ2UjTXsgv58edqwHw98Vj9A7p//PN+3mY5UfpqRVzvBsXnAdjg3OdqI/EQ85/+Vc4gXT7WigRMy!biRUPALFSwAACQE2Ynj1YwxKEdc07Wl2v9PpqWhlKkUxnCBwu1ChQqKBYsPmIG652ESWHgEDjqUs!jA==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 5204
 by: steve - Tue, 5 Apr 2022 19:55 UTC

Spiros Bousbouras wrote:
> On Sun, 03 Apr 2022 10:13:42 -0400
> Steve G <Sgonedes1977@gmail.com> wrote:
>> Spiros Bousbouras <spibou@gmail.com> writes:
>>
>>> The CLHS page for INLINE and NOTINLINE say that a compiler "is free to
>>> ignore" INLINE but "is not free to ignore" NOTINLINE .Why is that ?
>>
>> It is a programming thing. I usually use it with interfaces so that if
>> the code changes any dependent software will not have to be recompiled.
>
> Ok , that makes sense.
>
>> Ex...
>>
>> ;;;; Termcap Interface
>> (declaim (notinline tgetstr tgetnum tgetstr))
>>
>> (defun tgetflag (cap)
>> "Return value of termcap boolean capability <CAP>."
>> (declare (type simple-string cap))
>> (get-sequence cap))
>>
>> (defun tgetnum (cap)
>> "Return value of boolean capability <CAP>."
>> (declare (type simple-string cap))
>> (get-sequence cap))
>>
>> (defun tgetstr (cap)
>> "Return a string for capability <CAP>."
>> (declare (type simple-string cap))
>> (get-sequence cap))
>>
>>
>> If these functions where inlined then every time I recompile the file,
>> the entire program must be recompiled. This is similar to static
>> libraries vs. dynamic libraries. On unix that would be `.a' and `.so' .
>> On windows it would be a DLL.
>>
>> I think most people can agree that static libraries can lead to some
>> very agrevating problems.
>>
>>
>>> Are there
>>> some things which are guaranteed to work if a function has been declared
>>> NOTINLINE but may or may not work otherwise ?
>>
>> When debugging code :)
>>
>>
>> Seriousy, gcc has this problem like nothing else. When compiling with
>> GCC if you want to debug use -ggdb and an optimization of -Og.
>>
>> This is a new feature - a very good one, like -fverbose-asm.
>>
>>
>>> declarations for the following functions , is the following guaranteed to
>>> work as appears in the output below ?
>>>
>>> ==============
>>> * (defun foo1 () 'foo1)
>>>
>>> FOO1
>>> * (defun foo2 () 'foo2)
>>>
>>> FOO2
>>> * (defun foo3 () 'foo3)
>>>
>>> FOO3
>>> * (foo3)
>>>
>>> FOO3
>>> * (setf (symbol-function 'foo3) (function foo1))
>>
>>
>> No. I believe you are misunderstanding symbol-function. Symbol-function
>> is like using the C preprocessor but at run time.
>>
>>
>> ;;;; Globals and symbol-macros
>
> The examples below are about symbol macros. But I asked about SYMBOL-FUNCTION
> , a completely different thing.
>
>> (defstruct (screen (:copier nil) :named)
>> (namestring "Standard Screen" :type simple-string :read-only t)
>> ;; [ ... ]
>>
>> ;; cursor position movement
>> (cur-x 0 :type (unsigned-byte 16))
>> (cur-y 0 :type (unsigned-byte 16))
>> (max-x 0 :type (unsigned-byte 16))
>> (max-y 0 :type (unsigned-byte 16)))
>>
>>
>> (defvar *current-screen* (make-screen)
>> "The current screen object.")
>>
>> (defun current-screen ()
>> "Return the current screen object. This function is never called directly."
>> (the screen *current-screen*))
>>
>> (define-symbol-macro *LINES* (screen-max-x (current-screen)))
>> ;; "Number of rows for the current screen."
>>
>> (define-symbol-macro *COLUMNS* (screen-max-y (current-screen)))
>> ;; "Number of columns for the current screen."
>>
>>
>> The symbol-macro *COLUMNS* can be used like a global variable, but the
>> value is computed at runtime. Very cool feature.
>>
>>> #<FUNCTION FOO1>
>>> * (foo3)
>>>
>>> FOO1
>>> * (setf (symbol-function 'foo3) (function foo2))
>>>
>>> #<FUNCTION FOO2>
>>> * (foo3)
>>>
>>> FOO2
>>> ==============
>>>
>>> Might any declarations of INLINE affect the output ?
>>
>> When do you need the values? At runtime or compile time? I try not to
>> ever use global variables - I love the symbol-macro.
>
> I don't have a specific usage in mind , I was just experimenting. But
> lets say at runtime.

at runtime I would use a symbol macro not function slot.

Re: NOTINLINE

<t2i9u0$hp1$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17027&group=comp.lang.lisp#17027

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no_email@invalid.invalid (Zyni Moë)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Tue, 5 Apr 2022 20:48:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <t2i9u0$hp1$1@dont-email.me>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co>
<875ynq5k6h.fsf@l0ft.tpl>
<t2cqoe$er1$1@dont-email.me>
<ad7a9d4d-9cdb-4217-9ffa-cb4352242039n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 5 Apr 2022 20:48:00 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="44c3c206d45261ea6720b1371f2811fe";
logging-data="18209"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19j82mDulL1LrT042Voh90O5u2CkTcqiCM="
User-Agent: NewsTap/5.5 (iPad)
Cancel-Lock: sha1:CpTHyDMmbbMyNbWFWqnOtmy4+jQ=
sha1:hsfCsL2A3shC5ptp0u0A7CIY9ck=
 by: Zyni Moë - Tue, 5 Apr 2022 20:48 UTC

steve gonedes <sgonedes1977@gmail.com> wrote:

>> - Within a function named F, the compiler may (but is not required to)
>> assume that an apparent recursive call to a function named F refers to the
>> same definition of F, unless that function has been declared notinline. The
>> consequences of redefining such a recursively defined function F while it
>> is executing are undefined.
>>
>
> can you explain this mathematically or using pseudo-code?

This is text from the standard. However what it means is that in a case
like

.... no notinline drclaration for f ...

(defun f (...)
... no notinline declaration for f or intervening labels or flet for f
....
(f ...)
...)

The compiler may assume that the inner call to f refers to the outer
function and (for instance) avoid doing a full call. If there is a
notinline declaration (either free or bound) for f it may not make such
assumption and must do full call, so (f ...) is more or less (funcall
(fdefinition 'f) ...).

>
>> - A call within a file to a named function that is defined in the same file
>> refers to that function, unless that function has been declared notinline.
>> The consequences are unspecified if functions are redefined individually at
>> run time or multiply defined in the same file.
>>
>
> A call within a file?
>

A call made by code which occurs within the same file where the function is
defined, yes.

--
the small snake

Re: NOTINLINE

<99f066aa-3bd8-4e56-b294-6ef45f873cddn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17028&group=comp.lang.lisp#17028

  copy link   Newsgroups: comp.lang.lisp
X-Received: by 2002:a0c:f70d:0:b0:441:4558:b70c with SMTP id w13-20020a0cf70d000000b004414558b70cmr4620439qvn.82.1649191855270;
Tue, 05 Apr 2022 13:50:55 -0700 (PDT)
X-Received: by 2002:a05:6808:8a:b0:2da:429f:8cd3 with SMTP id
s10-20020a056808008a00b002da429f8cd3mr2203401oic.98.1649191854841; Tue, 05
Apr 2022 13:50:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.lisp
Date: Tue, 5 Apr 2022 13:50:54 -0700 (PDT)
In-Reply-To: <ad7a9d4d-9cdb-4217-9ffa-cb4352242039n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2620:0:102f:1005:bbf1:cb28:cf88:a161;
posting-account=05zmAwoAAAAJZM-3jv1hCWLHGZQceqwA
NNTP-Posting-Host: 2620:0:102f:1005:bbf1:cb28:cf88:a161
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <875ynq5k6h.fsf@l0ft.tpl>
<t2cqoe$er1$1@dont-email.me> <ad7a9d4d-9cdb-4217-9ffa-cb4352242039n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <99f066aa-3bd8-4e56-b294-6ef45f873cddn@googlegroups.com>
Subject: Re: NOTINLINE
From: taruss@google.com (Tom Russ)
Injection-Date: Tue, 05 Apr 2022 20:50:55 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 49
 by: Tom Russ - Tue, 5 Apr 2022 20:50 UTC

On Tuesday, April 5, 2022 at 12:50:52 PM UTC-7, sgoned...@gmail.com wrote:
> On Sunday, April 3, 2022 at 2:58:27 PM UTC-4, Zyni Moë wrote:
....
> > - Within a function named F, the compiler may (but is not required to)
> > assume that an apparent recursive call to a function named F refers to the
> > same definition of F, unless that function has been declared notinline. The
> > consequences of redefining such a recursively defined function F while it
> > is executing are undefined.
> >
> can you explain this mathematically or using pseudo-code?

I doubt it can be explained mathematically, as there is no real mathematical
notion of the redefinition of functions during their execution. But here is an
example in lisp:

..(defun f (x)
.. (cond ((<= x 0) -10)
.. ((eql x 10)
.. (setf (symbol-function 'f)
.. #'(lambda (y)
.. (cond ((<= y 0)
.. -1)
.. (t (print y) (f (1- y))))))
.. (f (1- x)))
.. (t (print x) (f (- x 5)))))

Try it with something like (f 30).

> > - A call within a file to a named function that is defined in the same file
> > refers to that function, unless that function has been declared notinline.
> > The consequences are unspecified if functions are redefined individually at
> > run time or multiply defined in the same file.
> >
> A call within a file?

At runtime, calling a function that is defined in the same file or perhaps more
generally in the same "translation unit". So if you define F and G in the same
file, and F calls G, the compiler is allowed to in-line G in the body of F.

Re: NOTINLINE

<t2icc7$4hs$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17029&group=comp.lang.lisp#17029

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: no_email@invalid.invalid (Zyni Moë)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
Date: Tue, 5 Apr 2022 21:29:43 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <t2icc7$4hs$1@dont-email.me>
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co>
<875ynq5k6h.fsf@l0ft.tpl>
<t2cqoe$er1$1@dont-email.me>
<ad7a9d4d-9cdb-4217-9ffa-cb4352242039n@googlegroups.com>
<99f066aa-3bd8-4e56-b294-6ef45f873cddn@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 5 Apr 2022 21:29:43 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="44c3c206d45261ea6720b1371f2811fe";
logging-data="4668"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+kD2cYDD84eJiyphQm/U08KpykpXNCgMA="
User-Agent: NewsTap/5.5 (iPad)
Cancel-Lock: sha1:l6XT2VzxYIqxynPoZ79f/5HH/Pk=
sha1:IdkX6gHRDs8LGIvaoFziHFWTmVA=
 by: Zyni Moë - Tue, 5 Apr 2022 21:29 UTC

Tom Russ <taruss@google.com> wrote:
> the compiler is allowed to in-line G in the body of F.
>

This is again not to do with inlining. Is rather to do with being allowed
to assume that definition of G is definition in that file, so call to G
does not need to go through function cell of G, can assume lambda list of G
etc. Whether G is inlined is other issue.

--
the small snake

Re: NOTINLINE

<87ee2brue3.fsf@l0ft.tpl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17030&group=comp.lang.lisp#17030

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 05 Apr 2022 18:19:42 -0500
From: @tevie G
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <875ynq5k6h.fsf@l0ft.tpl>
<t2cqoe$er1$1@dont-email.me>
<ad7a9d4d-9cdb-4217-9ffa-cb4352242039n@googlegroups.com>
<t2i9u0$hp1$1@dont-email.me>
Date: Tue, 05 Apr 2022 19:19:00 -0400
Message-ID: <87ee2brue3.fsf@l0ft.tpl>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:6XU4JUJRGUQE4epeib1XQJvo0lI=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Lines: 52
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-1Y5HpwFvnIckX+ApgUPbPAAsGDxeYqMEtXSLyCGqyXhPo8Yd2CjZrSkuitv6IADJnhZdoDX08xLLrLU!bUVrfQRrP5jjbXHNXukKX9Edp3kLIOqCNvZWtruf9wWMoVGo
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 2803
 by: @tevie G - Tue, 5 Apr 2022 23:19 UTC

Zyni Moë <no_email@invalid.invalid> writes:

> steve gonedes <sgonedes1977@gmail.com> wrote:
>
>>> - Within a function named F, the compiler may (but is not required to)
>>> assume that an apparent recursive call to a function named F refers to the
>>> same definition of F, unless that function has been declared notinline. The
>>> consequences of redefining such a recursively defined function F while it
>>> is executing are undefined.
>>>
>>
>> can you explain this mathematically or using pseudo-code?
>
> This is text from the standard. However what it means is that in a case
> like
>
> ... no notinline drclaration for f ...
>
> (defun f (...)
> ... no notinline declaration for f or intervening labels or flet for f
> ...
> (f ...)
> ...)

Thank You! Now I know where you are at...

> The compiler may assume that the inner call to f refers to the outer
> function and (for instance) avoid doing a full call. If there is a
> notinline declaration (either free or bound) for f it may not make such
> assumption and must do full call, so (f ...) is more or less (funcall
> (fdefinition 'f) ...).

yes, like flet or labels. I usually use declaim - not declare. never
thougt about it.

>>
>>> - A call within a file to a named function that is defined in the same file
>>> refers to that function, unless that function has been declared notinline.
>>> The consequences are unspecified if functions are redefined individually at
>>> run time or multiply defined in the same file.
>>>
>>
>> A call within a file?

Ahh. within scope.. my bad...

Re: NOTINLINE

<87a6czru9z.fsf@l0ft.tpl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17031&group=comp.lang.lisp#17031

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!buffer2.nntp.dca1.giganews.com!buffer1.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 05 Apr 2022 18:22:10 -0500
From: @tevie G
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <875ynq5k6h.fsf@l0ft.tpl>
<t2cqoe$er1$1@dont-email.me>
<ad7a9d4d-9cdb-4217-9ffa-cb4352242039n@googlegroups.com>
<99f066aa-3bd8-4e56-b294-6ef45f873cddn@googlegroups.com>
Date: Tue, 05 Apr 2022 19:21:28 -0400
Message-ID: <87a6czru9z.fsf@l0ft.tpl>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:dH9dFd2rge8HOGSWGV6Tv58ou6Y=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Lines: 42
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-osADPuhLN+oYtw99dyjzOzNETYR0CUCH6uS7bbEL6268LZqvs+r5/TR6wOq3DBTshzpBUL4svQxzVaI!ZrKG0SRyqm5XGJSG4j9WlmMf6zMZdInlEfaTcy6kdaCJ7Jbc
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 3026
 by: @tevie G - Tue, 5 Apr 2022 23:21 UTC

Tom Russ <taruss@google.com> writes:

> On Tuesday, April 5, 2022 at 12:50:52 PM UTC-7, sgoned...@gmail.com wrote:
>> On Sunday, April 3, 2022 at 2:58:27 PM UTC-4, Zyni Moë wrote:
> ...
>> > - Within a function named F, the compiler may (but is not required to)
>> > assume that an apparent recursive call to a function named F refers to the
>> > same definition of F, unless that function has been declared notinline. The
>> > consequences of redefining such a recursively defined function F while it
>> > is executing are undefined.
>> >
>> can you explain this mathematically or using pseudo-code?
>
> I doubt it can be explained mathematically, as there is no real mathematical
> notion of the redefinition of functions during their execution. But here is an
> example in lisp:
>
> .(defun f (x)
> . (cond ((<= x 0) -10)
> . ((eql x 10)
> . (setf (symbol-function 'f)
> . #'(lambda (y)
> . (cond ((<= y 0)
> . -1)
> . (t (print y) (f (1- y))))))
> . (f (1- x)))
> . (t (print x) (f (- x 5)))))
>
> Try it with something like (f 30).
>
>> > - A call within a file to a named function that is defined in the same file
>> > refers to that function, unless that function has been declared notinline.
>> > The consequences are unspecified if functions are redefined individually at
>> > run time or multiply defined in the same file.
>> >
>> A call within a file?
>
> At runtime, calling a function that is defined in the same file or perhaps more
> generally in the same "translation unit". So if you define F and G in the same
> file, and F calls G, the compiler is allowed to in-line G in the body of F.

like a compilation unit. My bad, I'm getting old, tire, and annoyinng.

Re: NOTINLINE

<87h777hz4c.fsf@l0ft.tpl>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17032&group=comp.lang.lisp#17032

  copy link   Newsgroups: comp.lang.lisp
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!border1.nntp.dca1.giganews.com!nntp.giganews.com!buffer1.nntp.dca1.giganews.com!buffer2.nntp.dca1.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 05 Apr 2022 18:47:41 -0500
From: Sgonedes1977@gmail.com (Steve G)
Newsgroups: comp.lang.lisp
Subject: Re: NOTINLINE
References: <2Z=vsGJa+iZYf2EtP@bongo-ra.co> <875ynq5k6h.fsf@l0ft.tpl>
<t2cqoe$er1$1@dont-email.me>
<ad7a9d4d-9cdb-4217-9ffa-cb4352242039n@googlegroups.com>
<t2i9u0$hp1$1@dont-email.me> <87ee2brue3.fsf@l0ft.tpl>
Date: Tue, 05 Apr 2022 19:46:59 -0400
Message-ID: <87h777hz4c.fsf@l0ft.tpl>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:JjwrtCbn5spM20TiOG76f89JkH4=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Lines: 18
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-kb7zX/YNBt4IyUci6aX5s5AoQKTS9wn33+5WPR7O2nTCKtOMa4uYeODn7L26VdsvD5lH6+FSVFPq6eG!Zxu1tNR18xI/gkITunxnISei+QAU+Aa7ll04vzUTjKo7NJoF
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Original-Bytes: 1903
 by: Steve G - Tue, 5 Apr 2022 23:46 UTC

"<Stevie G>" <Sgonedes1977@gmail.com> writes:

> Zyni Moë <no_email@invalid.invalid> writes:
>
>> steve gonedes <sgonedes1977@gmail.com> wrote:
>>
>>>> - Within a function named F, the compiler may (but is not required to)
>>>> assume that an apparent recursive call to a function named F refers to the
>>>> same definition of F, unless that function has been declared notinline. The
>>>> consequences of redefining such a recursively defined function F while it
>>>> is executing are undefined.
>>>>
>>>
>>> can you explain this mathematically or using pseudo-code?

I feel a bit foolish - I just read the paper. yes, with compilation
unit. Something struct me... just ramblings..

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor