jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | offtopic --> #lispcafe
deselby has joined #lisp
skye0[m] has joined #lisp
ms[m] has joined #lisp
kaisyu[m] has joined #lisp
ThaEwat has joined #lisp
dieggsy has joined #lisp
stargazesparkle has joined #lisp
santiagopim[m] has joined #lisp
infra_red[m] has joined #lisp
posthuman_egrego has joined #lisp
susam has joined #lisp
jdormit[m] has joined #lisp
loke[m] has joined #lisp
katco has joined #lisp
MrtnDk[m] has joined #lisp
etimmons has joined #lisp
dmiles[m] has joined #lisp
quanta[m] has joined #lisp
even4void[m] has joined #lisp
arichiardi[m] has joined #lisp
christopheroei[m has joined #lisp
eymebolofscrumpe has joined #lisp
jonas[m]2 has joined #lisp
anotherone9999[m has joined #lisp
ey[m] has joined #lisp
solideogloria[m] has joined #lisp
chipk[m] has joined #lisp
ey[m]1 has joined #lisp
ecm has joined #lisp
Lolicon[m] has joined #lisp
random-nick has quit [Ping timeout: 265 seconds]
remby has joined #lisp
random-nick has joined #lisp
theothornhill has joined #lisp
theothornhill has quit [Ping timeout: 258 seconds]
random-nick has quit [Ping timeout: 258 seconds]
theothornhill has joined #lisp
jonatack has quit [Ping timeout: 260 seconds]
rumbler31 has joined #lisp
sm2n has quit [Read error: Connection reset by peer]
theothornhill has quit [Ping timeout: 264 seconds]
sm2n has joined #lisp
gigetoo has quit [Ping timeout: 264 seconds]
renzhi has joined #lisp
surabax has quit [Quit: Leaving]
gigetoo has joined #lisp
theothornhill has joined #lisp
theothornhill has quit [Ping timeout: 240 seconds]
gigetoo has quit [Ping timeout: 240 seconds]
theothornhill has joined #lisp
Stanley00 has joined #lisp
gigetoo has joined #lisp
theothornhill has quit [Ping timeout: 246 seconds]
ikrabbe|2 has joined #lisp
nij has joined #lisp
matryoshka has quit [Quit: ZNC 1.8.2 - https://znc.in]
Stanley00 has quit [Ping timeout: 256 seconds]
matryoshka has joined #lisp
ikrabbe has quit [Ping timeout: 240 seconds]
Xach has quit [Ping timeout: 240 seconds]
akoana has left #lisp ["Leaving"]
Xach has joined #lisp
nij has quit [Remote host closed the connection]
nij has joined #lisp
theothornhill has joined #lisp
Alfr_ has joined #lisp
mgxm_ has joined #lisp
aindilis has quit [Remote host closed the connection]
Colleen has quit [Remote host closed the connection]
mgxm has quit [Quit: ....]
bilegeek has quit [Remote host closed the connection]
ex_nihilo has quit [Remote host closed the connection]
Alfr has quit [Remote host closed the connection]
gko has quit [Remote host closed the connection]
mgxm_ is now known as mgxm
Colleen has joined #lisp
nij has quit [Remote host closed the connection]
zyz__ has joined #lisp
aindilis` has joined #lisp
theothornhill has quit [Ping timeout: 272 seconds]
aindilis` has quit [Remote host closed the connection]
pillton has quit [Read error: Connection reset by peer]
pillton has joined #lisp
theothornhill has joined #lisp
elflng has quit [Ping timeout: 256 seconds]
theothornhill has quit [Ping timeout: 240 seconds]
iozuvcxh has joined #lisp
bilegeek has joined #lisp
iozuvcxh has quit [Quit: Leaving]
zyz_ has joined #lisp
cron has joined #lisp
zyz__ has quit [Ping timeout: 258 seconds]
cron has quit [Quit: Leaving]
cron has joined #lisp
cron has quit [Client Quit]
cron has joined #lisp
<jeosol> #vb%otd$_mp!
Josh_2 has quit [Ping timeout: 246 seconds]
phantomics has joined #lisp
zacts has quit [Quit: leaving]
theothornhill has joined #lisp
X-Scale` has joined #lisp
notzmv has quit [Remote host closed the connection]
cron has quit [Quit: Leaving]
theothornhill has quit [Ping timeout: 260 seconds]
crond has joined #lisp
liberliver1 has joined #lisp
aeth_ has joined #lisp
aeth has quit [Disconnected by services]
billstclair_ has joined #lisp
chewbranca_ has joined #lisp
aeth_ is now known as aeth
mjl_ has joined #lisp
travv0_ has joined #lisp
chewbranca has quit [Ping timeout: 256 seconds]
mjl has quit [Ping timeout: 256 seconds]
travv0 has quit [Ping timeout: 256 seconds]
billstclair has quit [Ping timeout: 256 seconds]
remby_ has joined #lisp
grfn has joined #lisp
grfn has quit [Ping timeout: 256 seconds]
liberliver has quit [Read error: Connection reset by peer]
parisienne has quit [Ping timeout: 256 seconds]
X-Scale has quit [Ping timeout: 256 seconds]
spacebat2 has quit [Ping timeout: 256 seconds]
karlosz has quit [Read error: Connection reset by peer]
grfn has joined #lisp
X-Scale` is now known as X-Scale
grfn has quit [Changing host]
liberliver1 is now known as liberliver
mjl_ is now known as mjl
travv0_ is now known as travv0
chewbranca_ is now known as chewbranca
billstclair_ is now known as billstclair
spacebat2 has joined #lisp
parisienne has joined #lisp
remby has quit [Ping timeout: 256 seconds]
remby_ is now known as remby
zacts has joined #lisp
[d] has quit [Remote host closed the connection]
[d] has joined #lisp
theothornhill has joined #lisp
notzmv has joined #lisp
crond has quit [Quit: Leaving]
toorevitimirp has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
toorevitimirp has joined #lisp
theothornhill has quit [Ping timeout: 246 seconds]
dbotton has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
gko has joined #lisp
enzuru has joined #lisp
skapata has quit [Remote host closed the connection]
Stanley00 has joined #lisp
attila_lendvai has quit [Ping timeout: 240 seconds]
zyz__ has joined #lisp
zyz_ has quit [Ping timeout: 272 seconds]
aartaka_d has joined #lisp
aartaka has quit [Ping timeout: 260 seconds]
iskander- has quit [Ping timeout: 240 seconds]
dbotton has quit [Quit: Leaving]
orivej has joined #lisp
zyz_ has joined #lisp
theothornhill has joined #lisp
elflng has joined #lisp
zyz__ has quit [Ping timeout: 256 seconds]
theothornhill has quit [Ping timeout: 256 seconds]
theothornhill has joined #lisp
drl has quit [Quit: Leaving]
aeth_ has joined #lisp
aeth has quit [Ping timeout: 240 seconds]
aeth_ is now known as aeth
aeth_ has joined #lisp
choegusung has joined #lisp
choegusung has quit [Client Quit]
zyz__ has joined #lisp
aeth__ has joined #lisp
aeth has quit [Ping timeout: 246 seconds]
aeth__ is now known as aeth
zyz_ has quit [Ping timeout: 264 seconds]
Stanley00 has quit [Remote host closed the connection]
aeth_ has quit [Ping timeout: 264 seconds]
hjudt has quit [Ping timeout: 264 seconds]
zyz_ has joined #lisp
Stanley00 has joined #lisp
mindCrime_ has quit [Ping timeout: 260 seconds]
zyz__ has quit [Ping timeout: 246 seconds]
choegusung has joined #lisp
choegusung has quit [Client Quit]
Stanley00 has quit []
remby has quit [Quit: remby]
wxie has joined #lisp
remby has joined #lisp
Alfr has joined #lisp
zacts has quit [Quit: leaving]
zacts has joined #lisp
Alfr_ has quit [Ping timeout: 260 seconds]
jeosol has quit [Quit: Ping timeout (120 seconds)]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
zyz__ has joined #lisp
zacts has quit [Quit: leaving]
zyz_ has quit [Ping timeout: 264 seconds]
<beach> Good morning everyone!
enzuru has quit [Ping timeout: 246 seconds]
torbo has joined #lisp
zyz_ has joined #lisp
zyz__ has quit [Ping timeout: 240 seconds]
theothornhill has quit [Ping timeout: 256 seconds]
aindilis has joined #lisp
_linker_ has quit [Remote host closed the connection]
enzuru has joined #lisp
<remby> hello
<beach> Hello remby.
<remby> can you do bitmaps in lisp?
<beach> Sure.
<beach> Give the keyword argument :ELEMENT-TYPE 'BIT to MAKE-ARRAY.
<remby> amazing
torbo has quit [Remote host closed the connection]
<beach> Why is that "amazing"?
wsinatra_ has quit [Quit: WeeChat 3.0]
ggoes has quit [Ping timeout: 244 seconds]
<edgar-rft> Lisp has lots of amazing bits :-)
<remby> well I was considering how to do that in at least 3 languages and I couldn't do it so easily
<aeth> now try making a 10D array in at least 3 languages.
<remby> that should be technically possible? I've not tried past 3 dimesions
<beach> remby: After you start using Common Lisp, there is typically fewer and fewer reasons to use the languages you knew before.
thatpythonboy has joined #lisp
<remby> but muh scheme :'-)
<aeth> remby: in SBCL 2.0.11, SBCL controversially reduced its ARRAY-RANK-LIMIT from 65529 to 256.
<remby> why was it so high by default?
<remby> do lots of folks do db stuff?
<beach> remby: The rank is the number of dimensions.
<beach> remby: Not the size of the array.
<remby> yeah
<beach> There was probably just no reason to limit it before.
<aeth> Well, you'll probably run out of memory with a 65529D array, but they didn't try to optimize large dimensional arrays before so they didn't really care
<aeth> once they needed to optimize it, the particular optimization required a cap
<remby> ah cool
<edgar-rft> Every bit of a bit-array should have the right to live in its own dimension.
rumbler31 has quit [Remote host closed the connection]
<aeth> In some implementations it could be e.g. MOST-POSITIVE-FIXNUM, which can be up to 4611686018427387903 on a 64-bit platform if a FIXNUM is represented as 63 bits (62 bits if treated as unsigned)
<aeth> Good luck making one of those, though
rumbler31 has joined #lisp
<Bike> i kind of want to know what kind of application uses a 257 dimensional array.
<remby> database possibly
<Bike> what would a database use a high dimensional array for?
<beach> That would be very wasteful as s representation for just about anything.
<Bike> https://github.com/sbcl/sbcl/commit/b628f29e3b3651f8a3a83d28f17b9d514e997849 ah, here's the optimization. simpler than the last time i tried to look up the reason for an sbcl change
<aeth> The larger it is, the more likely you'll want to use something sparse rather than just directly using array indices
<remby> why's that?
<remby> isn't this better for cache?
thatpythonboy has quit [Ping timeout: 272 seconds]
<Bike> you're not going to fit a 257 dimensional array with appreciable dimensions into a cache, i don't think
<remby> yeah, I can't really fathom it
<Bike> if each dimension is 2 long, there are what, 2^257 elements in it?
<remby> that looks correct
thatpythonboy has joined #lisp
<Bike> aeth described the change as "controversial" so i want to hear the controversy
<Bike> i mean assuming that wasn't a joke
<aeth> (make-array (loop :repeat 255 :collect 1) :initial-element 0)
<aeth> (make-array (loop :repeat 255 :collect 2) :initial-element 0)
<aeth> heh, 57896044618658097711785492504343953926634992332820282019728792003956564819968 isn't an index. So already that's too many.
<aeth> Bike: People complain when limits are lowered, I guess
<aeth> iirc it was resolved by calculating the memory requirements
<beach> People should do a bit of thinking before complaining.
<beach> I guess that's too much to ask.
<aeth> This is a very practical array, though. (apply #'aref (make-array (loop :repeat 255 :collect 1) :initial-element 0) (loop :repeat 255 :collect 0)) ;-)
<Bike> btw you know you can do (make-list 255 :initial-element 1) right
<Bike> i suppose it's not any shorter than the loop golfwise
<beach> No, but it's more specific, so preferable.
<moon-child> even most apl implementations limit the rank of an array at 15. I can't imagine why anybody would want anything higher than maybe 7 or 8
Stanley00 has joined #lisp
<remby> most apl implementations are proprietary?
<remby> or maybe this is in the wild
<aeth> the lowest one that "works" for me is (make-array (loop :repeat 61 :collect 2) :element-type 'bit :initial-element 0)
<aeth> but it results in a heap exhaustion
thatpythonboy has quit [Ping timeout: 272 seconds]
<moon-child> remby: eh, gnu apl caps it at 8 :)
<aeth> empirically, if sb-index is not increased, then SBCL could get away with using a cap of 63 and using the rest of the bits for something else
<aeth> moon-child: then APL doesn't let you do this: (make-array (make-list 20 :initial-element 2) :element-type 'bit :initial-element 0)
ikrabbe has joined #lisp
<moon-child> aeth: well, depends on the apl impl. April will, since it uses cl semantics
thatpythonboy has joined #lisp
<aeth> Everything should use CL semantics.
ikrabbe|2 has quit [Ping timeout: 260 seconds]
zyz__ has joined #lisp
zyz_ has quit [Ping timeout: 240 seconds]
<remby> how long is the CL spec actually?
ebrasca has joined #lisp
<moon-child> 1k pages I think? Something like that
orivej has quit [Ping timeout: 260 seconds]
theothornhill has joined #lisp
<beach> One quotation says 1350 pages.
<ebrasca> Good morning!
<remby> good day
<beach> Hello ebrasca.
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
theothornhill has quit [Ping timeout: 260 seconds]
domovod has joined #lisp
lowryder has quit [Ping timeout: 260 seconds]
lowryder has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
ealfonso has joined #lisp
<ealfonso> is there a way to quickload some packages in a .lisp file before the reader complains about "package X does not exist"?
<White_Flame> #.(ql:quickload ...)
<White_Flame> kinda hacky, only useful for scrap prototypes, don't build that into anything
theothornhill has joined #lisp
<White_Flame> oh, the return value will be taken as source code, so: #.(not (ql:quickload ...)) or whatever to eat it
enzuru has quit [Quit: leaving]
enzuru has joined #lisp
theothornhill has quit [Ping timeout: 264 seconds]
<aeth> probably just PROGN with a NIL at the end or PROG1 with a NIL at the start
drbluefall has joined #lisp
<White_Flame> .oO( not code golfed enough! ;) )
domovod has quit [Quit: WeeChat 3.0]
theothornhill has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
Bike has quit [Quit: sleeping]
benjamin-l has joined #lisp
theothornhill has quit [Ping timeout: 246 seconds]
theothornhill has joined #lisp
thatpythonboy has quit [Ping timeout: 264 seconds]
theothornhill has quit [Read error: Connection reset by peer]
theothornhill has joined #lisp
splittist_ is now known as splittist
benjamin-l has quit [Quit: WeeChat 3.0]
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
theothornhill has quit [Ping timeout: 256 seconds]
theothornhill has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
drbluefall has quit [Ping timeout: 260 seconds]
luckless has quit [Ping timeout: 268 seconds]
theothornhill has quit [Ping timeout: 256 seconds]
luckless has joined #lisp
theothornhill has joined #lisp
theothornhill has quit [Ping timeout: 246 seconds]
sauvin has joined #lisp
wxie1 has joined #lisp
jello_pudding has quit [Ping timeout: 264 seconds]
wxie has quit [Ping timeout: 264 seconds]
wxie1 is now known as wxie
jello_pudding has joined #lisp
zyz_ has joined #lisp
pagnol has joined #lisp
zyz__ has quit [Ping timeout: 240 seconds]
theothornhill has joined #lisp
waleee-cl has quit [Quit: Connection closed for inactivity]
bilegeek has quit [Quit: Leaving]
theothornhill has quit [Ping timeout: 256 seconds]
remby has quit [Quit: remby]
rumbler3_ has joined #lisp
grfn` has joined #lisp
entel has quit [Ping timeout: 256 seconds]
nckx has quit [Ping timeout: 256 seconds]
grfn has quit [Ping timeout: 256 seconds]
grfn` is now known as grfn
entel has joined #lisp
rumbler31 has quit [Ping timeout: 256 seconds]
nckx has joined #lisp
theothornhill has joined #lisp
shka_ has joined #lisp
theothornhill has quit [Ping timeout: 264 seconds]
theothornhill has joined #lisp
zyz_ has quit [Remote host closed the connection]
zyz_ has joined #lisp
andreyorst` has joined #lisp
jeosol has joined #lisp
narimiran has joined #lisp
IPmonger has quit [Ping timeout: 256 seconds]
IPmonger has joined #lisp
Alfr has quit [Quit: Leaving]
theothor` has joined #lisp
zyz__ has joined #lisp
zyz_ has quit [Ping timeout: 256 seconds]
theothor` has quit [Ping timeout: 256 seconds]
ealfonso has quit [Remote host closed the connection]
aeth has quit [Ping timeout: 256 seconds]
aeth has joined #lisp
theothornhill has quit [Remote host closed the connection]
iskander has joined #lisp
iskander- has joined #lisp
iskander| has joined #lisp
theothor` has joined #lisp
iskander has quit [Ping timeout: 256 seconds]
grobe0ba has quit [Ping timeout: 260 seconds]
iskander- has quit [Ping timeout: 272 seconds]
theothor` has quit [Ping timeout: 265 seconds]
rumbler3_ has quit [Remote host closed the connection]
rumbler31 has joined #lisp
pillton has quit [Ping timeout: 264 seconds]
theothor` has joined #lisp
remby has joined #lisp
heisig has joined #lisp
gaqwas has joined #lisp
gaqwas has joined #lisp
theothor` has quit [Ping timeout: 256 seconds]
Major_Biscuit has joined #lisp
logand has joined #lisp
mindCrime_ has joined #lisp
orivej has joined #lisp
heisig has quit [Ping timeout: 256 seconds]
theothor` has joined #lisp
Alfr has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
totoro2022 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
theothor` has quit [Ping timeout: 264 seconds]
totoro2022 has joined #lisp
Cymew has joined #lisp
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 260 seconds]
fourier has quit [Read error: Connection reset by peer]
ljavorsk has joined #lisp
fourier has joined #lisp
ym_ has joined #lisp
ym has quit [Ping timeout: 246 seconds]
pve has joined #lisp
anticrisis has quit [Read error: Connection reset by peer]
copec has quit [Quit: checkity check out.]
copec has joined #lisp
Fade has quit [Ping timeout: 240 seconds]
Fade has joined #lisp
mindCrime_ has quit [Ping timeout: 264 seconds]
heisig has joined #lisp
xanderle has quit [Ping timeout: 265 seconds]
theothor` has joined #lisp
hjudt has joined #lisp
remby has quit [Quit: remby]
frodef has joined #lisp
pankajsg has joined #lisp
theothor` has quit [Ping timeout: 264 seconds]
hendursaga has quit [Ping timeout: 268 seconds]
theothor` has joined #lisp
theothor` has quit [Ping timeout: 256 seconds]
ikrabbe|2 has joined #lisp
ikrabbe|2 has quit [Client Quit]
xanderle has joined #lisp
theothornhill has joined #lisp
hjudt has quit [Quit: leaving]
attila_lendvai has joined #lisp
Cymew has quit [Ping timeout: 260 seconds]
borodust has left #lisp [#lisp]
jeosol has quit [Ping timeout: 248 seconds]
borodust has joined #lisp
Cymew has joined #lisp
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
gaqwas has quit [Remote host closed the connection]
<luis> White_Flame: using EVAL-WHEN would be clearer, despite the bad code golf score :)
imode has quit [Ping timeout: 265 seconds]
surabax has joined #lisp
toorevitimirp has quit [Ping timeout: 264 seconds]
hjudt has joined #lisp
<White_Flame> luis: wasn't sure if that was sufficient in both load & compile situations
<White_Flame> but still, .asd dependencies and a separate package.lisp file, this is the way
<luis> White_Flame: no _need_ for a separate package.lisp file I don't think, just a common convention.
<phoe> White_Flame: it is sufficient in both load and compile situations
<phoe> if you provide all situations then it's enough
<White_Flame> I tend to put exports where things are defined. In such a case, a reevaluated defpackage whines about the empty exports not matching (in sbcl)
<phoe> uiop:define-package solves this
frodef has quit [Remote host closed the connection]
zyz__ has quit [Ping timeout: 256 seconds]
frodef has joined #lisp
wxie has quit [Ping timeout: 256 seconds]
theothor` has joined #lisp
theothor` has quit [Ping timeout: 246 seconds]
grobe0ba has joined #lisp
Lord_of_Life_ has joined #lisp
Codaraxis__ has quit [Ping timeout: 265 seconds]
gxt has quit [Ping timeout: 268 seconds]
Lord_of_Life has quit [Ping timeout: 246 seconds]
Lord_of_Life_ is now known as Lord_of_Life
varjag has joined #lisp
gxt has joined #lisp
scymtym_ has quit [Read error: Connection reset by peer]
scymtym has joined #lisp
arora has joined #lisp
gareppa has joined #lisp
pagnol has quit [Remote host closed the connection]
gareppa has quit [Quit: Leaving]
rumbler31 has quit [Remote host closed the connection]
rumbler31 has joined #lisp
hendursaga has joined #lisp
paulj has joined #lisp
theothor` has joined #lisp
mindCrime_ has joined #lisp
vegansbane6 has quit [Quit: The Lounge - https://thelounge.chat]
kini has quit [Ping timeout: 264 seconds]
theothor` has quit [Ping timeout: 260 seconds]
kini has joined #lisp
amerlyq has joined #lisp
theothor` has joined #lisp
theothor` has quit [Ping timeout: 265 seconds]
attila_lendvai has quit [Quit: Leaving]
mindCrime_ has quit [Ping timeout: 264 seconds]
arora has quit [Quit: leaving]
igemnace has quit [Quit: WeeChat 3.0]
theothor` has joined #lisp
vegansbane6 has joined #lisp
VincentVega has joined #lisp
theothor` has quit [Ping timeout: 264 seconds]
galex-713_ has quit [Ping timeout: 240 seconds]
sveit has quit [Ping timeout: 240 seconds]
simplegauss has quit [Ping timeout: 240 seconds]
thonkpod has quit [Ping timeout: 244 seconds]
thonkpod has joined #lisp
skapata has joined #lisp
OlCe has quit [Ping timeout: 256 seconds]
sveit has joined #lisp
simplegauss has joined #lisp
theothor` has joined #lisp
theothor` has quit [Ping timeout: 246 seconds]
Xach has quit [Changing host]
Xach has joined #lisp
theothor` has joined #lisp
theothor` has quit [Ping timeout: 272 seconds]
theothornhill has quit [Remote host closed the connection]
theothor` has joined #lisp
Stanley00 has quit [Remote host closed the connection]
terpri has joined #lisp
Major_Biscuit has quit [Ping timeout: 272 seconds]
terpri_ has quit [Ping timeout: 260 seconds]
theothor` has quit [Ping timeout: 265 seconds]
scymtym has quit [Ping timeout: 272 seconds]
andreyorst` has quit [Quit: andreyorst`]
andreyorst` has joined #lisp
theothor` has joined #lisp
scymtym has joined #lisp
theothor` has quit [Ping timeout: 264 seconds]
Major_Biscuit has joined #lisp
andreyorst` has quit [Quit: andreyorst`]
andreyorst` has joined #lisp
nicktick has joined #lisp
waleee-cl has joined #lisp
<jmercouris> I do not understand how cl-markup markup macro works
<jmercouris> I have the following: (user-interface::object-expression q) -> (:P :ID 1 "")
<jmercouris> (markup:markup (:P :ID 1 "")) -> <p id=\"1\"></p>
<jmercouris> and of course I could do `(markup:markup ,(user-interface::object-expression q))
<jmercouris> however, I want to just be able to do something like (markup:markup (user-interface::object-expression q))
<jmercouris> I want to take an object, and have it emit some SEXP by some function and have that be processed by cl-markup
<jmercouris> however markup:markup is a macro...
<jmercouris> which means it wont process my form within the markup sexp!
<jmercouris> unless I further wrap it :-(
<jmercouris> unless there is something I am missing here
<jmercouris> some clever trick...
<jackdaniel> how about (defun markup* (object) (eval `(markup ,object))
ukari has quit [Remote host closed the connection]
<jmercouris> markup* does exist as a functional version, maybe I should
<jackdaniel> why didn't you use it in the first place then?
<jmercouris> it involved changing a lot of other code
ukari has joined #lisp
theothor` has joined #lisp
theothor` has quit [Ping timeout: 240 seconds]
<jmercouris> lots of commas
<phoe> for the future, you can also funcall the macro-function
<jmercouris> I could make a macro that evalutes forms?
<jmercouris> or is that a dangerous road to go down
<phoe> what do you mean, evaluates?
<jmercouris> I wwas thinking evaluate if it is one of my user-interface library forms, otherwise do not
<phoe> it calls EVAL inside?
<jmercouris> yeah
<jmercouris> maybe that is really dirty though
<phoe> dangerous
<jmercouris> also the object would have to already exist
<phoe> especially because EVAL works in a null environment, so bugs will happen
<jmercouris> and it may not exist at that time
<jmercouris> I'll meditate on this problem some more
<jackdaniel> if I understand correctly, you will need to change the code anyway, so "lot's of code" argument goes away -- in that case what is the problem with using the function markup* in the library?
<jmercouris> I guess nothing really
<jmercouris> I guess my library could always be used with markup:markup* only
<jmercouris> that would really simplify things
<jmercouris> I was trying to support aslo markup:markup
<jmercouris> s/aslo/also
<jmercouris> seems I need to practice with sl some more
theothor` has joined #lisp
ljavorsk has quit [Ping timeout: 265 seconds]
theothor` has quit [Ping timeout: 260 seconds]
Bike has joined #lisp
zaquest has quit [Quit: Leaving]
hendursaga has quit [Quit: hendursaga]
hendursaga has joined #lisp
zaquest has joined #lisp
luni has joined #lisp
renzhi has quit [Ping timeout: 272 seconds]
grobe0ba_ has joined #lisp
grobe0ba has quit [Ping timeout: 256 seconds]
shka_ has quit [Remote host closed the connection]
vegansbane69 has joined #lisp
grobe0ba_ is now known as grobe0ba
andreyorst` has quit [Ping timeout: 256 seconds]
vegansbane6 has quit [Ping timeout: 256 seconds]
cage_ has joined #lisp
nicktick has quit [Ping timeout: 246 seconds]
orivej has quit [Ping timeout: 240 seconds]
andreyorst` has joined #lisp
euandreh has quit [Ping timeout: 264 seconds]
euandreh has joined #lisp
jonatack has joined #lisp
jonatack has quit [Client Quit]
shka_ has joined #lisp
Lycurgus has joined #lisp
theothor` has joined #lisp
gxt has quit [Ping timeout: 268 seconds]
gxt has joined #lisp
theothor` has quit [Ping timeout: 272 seconds]
nij has joined #lisp
<nij> In the source code, it seems that #'apply is ill-defined. https://bpa.st/NYNBC .. Indeed, the first cond drops you in an infinite loop apparently. And indeed, by copying the code and change each "apply" to "my-apply", I obtained a function #'my-apply that never ends. What's going on here?
<nij> Source code as in `/usr/share/sbcl-source/src/code`.
<edgar-rft> nij: (answer to your clschool question from a few hours ago) if you *need* AND/OR functions, for example as arguments to FUNCALL or APPLY, the the intended way is to use EVERY (function) instead of AND (macro), and SOME (function) instead of OR (macro)
<Bike> nij: sbcl has a compiler transformation that converts APPLY calls to something else.
theothor` has joined #lisp
<Bike> this definition is for the case where the actual apply function is called, like because it's used as an argument to some higher order function.
random-nick has joined #lisp
<phoe> nij: same stuff as with (defun car (x) (car x))
<beach> That kind of code is not pretty if you ask me.
<phoe> IIRC we were talking about it before
<phoe> and it probably was even with you
<beach> Possibly.
<phoe> beach: sure it isn't, but that's what works
<nij> edgar-rft: Oh! Indeed! #'SOME and #'EVERY are almost what I want, only did I need a curried version. I have (finally) implemented one myself.. but will switch back to currying those two standard functions. thanks :)
<phoe> beach: I didn't meant you, I meant nij
<beach> OK.
Stanley00 has joined #lisp
<jackdaniel> there are other things that could work too, and some of them are pretty
<nij> ......
<nij> I don't like this, by a lot.
<nij> But lemme try to see why they did it @@
<phoe> if you come from a mathematical background then sure thing you don't like it
<phoe> the inner CAR call is open-coded by the compiler.
<nij> me \in {math person}
<jackdaniel> it is ugly also from the programmer background - this definition is not technically correct and relies on information that is not available locally
<nij> Then the problem becomes.. how would the user know which apply is which apply?
<nij> And which car is which car?
<phoe> nij: there's only one CAR and only one APPLY
<jackdaniel> (not technically correct when taken in isolation)
<Xach> nij: as kent pitman once said, the model you can use initially is: "built-in functions are given by god"
<beach> nij: APPLY can not be written in portable Common Lisp.
<phoe> the user doesn't need to understand compiler internals in order to use CAR or APPLY
<nij> Let's just talk about CAR as it's much shorter, and the problem seems to be the same :)
<nij> (defun car (list) (car list))
theothor` has quit [Ping timeout: 260 seconds]
<phoe> nij: by doing DEFUN CAR, you become a Common Lisp implementer
<nij> Sure.
<phoe> how does your implementation represent cons cells?
<nij> I understand the need of special operators.
<phoe> okay then
<nij> But I hope they make them clear .. and do not redefine them afterwards
<jackdaniel> beach: could it be implemented if we exploit the fact, that call-arguments-limit is an integer?
<phoe> (defun car (list) (magic))
<phoe> that's an equivalent definition
<beach> jackdaniel: Possibly so, sure.
<jackdaniel> I mean: portably
<beach> I believe so, yes.
Stanley00 has quit [Ping timeout: 260 seconds]
<phoe> also, "they make them clear" - who's "they"?
<jackdaniel> got it
<Bike> you can have (apply function arg1 ... argl) as (multiple-value-call function arg1 ... (values-list argl)), which is what sbcl does. and then since multiple-value-call is a special operator it's "fine" in that the magic is on the special operator
<phoe> jackdaniel: oh, dispatching on the list length?
<nij> phoe: who's they --> the secret spirits who implemented sbcl xD
drbluefall has joined #lisp
Wezl has joined #lisp
<jackdaniel> yes, and transforming to funcall
pfdietz has joined #lisp
<nij> oh ok i think im a bit calmed down
<nij> this is a Lisp 3 issue
<beach> Bike: Interesting.
<nij> (not Lisp 1 nor Lisp 2)
<jackdaniel> n.b ecl does that to a certain number of arguments (64 if I recall correctly), after that it indeed passes arguments by other means
<nij> namely, a symbol can not only contain a normal object and a function
<nij> it can as well contain a special operator
<Bike> well, they're also operators.
<phoe> I'll have an issue with the word "contains"
<phoe> and also the namespaces for functions, macros, and specops are actually the same namespace.
<nij> before the epic (defun car (list) (car list)), car was only a special operator
<nij>
<phoe> it wasn't though, it's just a function
<Bike> no, nij is on the right track.
<nij> :( then im grumpy again xD
caret has joined #lisp
<phoe> beach noted in the previous discussion that it should have been written differently if this were clean code
<Bike> here's a better example for you. write your my-apply, and then do (define-compiler-macro my-apply (function &rest arglist) `(multiple-value-call ,@(butlast arglist) (values-list ,(first (last arglist)))))
<beach> phoe: OK.
<phoe> (defun car (x) (primop-car x))
<Bike> that's pretty close to how sbcl works, if you assume that the compiler macro expansion is always used.
<beach> nij: Maybe you prefer the SICL definition of CAR: (defun car (x) (if (consp x) (cleavir-primop:car x) (if (null x) x (error...))))
<phoe> or rather
<phoe> oh yes, this one
<nij> oh yes!
<nij> At least it makes it clear that it's from another primop!
<beach> The primop is indeed treated as a special operator.
<beach> There is no other way.
<nij> I think this is a good way.
<nij> Special operators must exist. I have no problem with that.
pfdietz40 has joined #lisp
<aeth> well...
<aeth> in theory it could just be done in the hardware instead
<nij> Hi aeth
VincentVega has quit [Quit: Ping timeout (120 seconds)]
<aeth> (there's just no money in Lisp machines anymore)
pfdietz has quit [Client Quit]
<aeth> hi nij
<nij> And even with pencils and papers!
<beach> aeth: You would still have to connect the CAR function to whatever the hardware does.
Lycurgus has quit [Quit: Exeunt]
<nij> pencil + paper + indefinite lifespan => turing machine
theothornhill has joined #lisp
<nij> MMk.. so for now I don't want to change sbcl implementors' mind. (`$ whoami` xD)
rumbler31 has quit [Remote host closed the connection]
<nij> The practical question is then.. how do I tell if something dirty is happening?
rumbler31 has joined #lisp
<phoe> what do you mean, dirty
<nij> Is there a list of "exceptions"?
<phoe> yes, it's called the CL package
<nij> E.g. (defun car (list) (car list)) <-- this is not clean, thus dirty.
<nij>
<phoe> the implementation can do whatever it wants while it implements the functionalities provided by symbols in the CL package
<beach> nij: When you look at system code, in order to understand it fully, you need to understand how the system does compilation and bootstrapping.
<jackdaniel> nij: you may treat it as an implementaiton detail - what Xach quoted is very accurate
<nij> jackdaniel: agree, and agree with Xach's quote.
<nij> But I hope there's a way to tell if something magical is happening, without looking into the source of the implementation.
<nij> There should be a list specifying where magics could be, right?
<beach> nij: Again, when you look at system code, in order to understand it fully, you need to understand how the system does compilation and bootstrapping.
<phoe> as I said X weeks ago, a Lisp implementation can implement the function CL:+ by sending a question to Mechanical Turk over the internet.
<phoe> and it'll be conforming.
<nij> beach: right, agree on that too. Is reading sbcl's source the only way to achieve?
<phoe> the list specifying where magics are would need to be maintained by each implementation, and I have no idea of what benefit would be other than for maintainers and implementers.
<jackdaniel> nij: from the "outside" behavior operators specified as functions work like functions, period - nothing dirty happens
<beach> nij: They may have documented it too.
<phoe> nij: yes, studying the implementation and asking people who are knowledgeable in how it works.
<jackdaniel> you may spot something magical when you actually look into the implementation code
frodef has quit [Ping timeout: 240 seconds]
theothor` has joined #lisp
<jackdaniel> but that's actually poking behind the event horizont :)
<nij> jackdaniel: haha ok!
<nij> Ok... I see.
luni has quit [Quit: Connection closed]
<beach> I think you will find similar "magic" in every implementation. In SICL for instance, you will see (defclass standard-class (...) (...))
theothor` has quit [Ping timeout: 240 seconds]
<nij> Magic is fine. But I wish for a clear notice while magic is near ;)
<nij> But fine, as it's not practical too much, it depends on the implementors if they want to make it clear or not. And that's their personal choice.
<phoe> if you see a CL symbol being defined somewhere, it means that you're already in the magic zone
<nij> Well, definition of the function #'car could be defined "recursively".
<beach> nij: Then, I would have to annotate pretty much every class definition of a system class. That can become quite annoying to read.
<nij> We know that's not the case immediately because it's too easy.
<nij> But there might be other magic that's not as easy.
<nij> beach: as you posted, (cleavir-primop:car x) is a nice work-around.
<nij> namely.. by specifying a certain set of namespaces where magic can happen.
<beach> It is not a "workaround". It is the semantics of CAR.
<phoe> I'll repeat myself: the CL package is one such namespace :D
<Bike> as jackdaniel noted, it's not magic that has any conceivable effect on a conforming lisp program.
<nij> phoe: oh yeah.. that's right.
aartaka_d has joined #lisp
<Bike> that's why there's no provision for telling you about it. You only need to care if you're curious about how sbcl is written.
<nij> I should have said.. then, that
<nij> "by specifying a certain set of namespaces where magic AND ONLY MAGIC can happen."
<beach> nij: My defclass example is "magic" in that the metaclass of standard-class is standard-class so it has to exist in order to be defined this way.
<beach> nij: It can't be fixed by namespaces.
<Bike> things that are only special operators ARE magic in a sense that you can actually discern, which is why special-operator-p exists.
<nij> Bike: right, i understand. I'm just itchy xD
<nij> beach: I don't understand class yet so I can't say.. but I believe it's doable. (but not practical)
<beach> It is both doable and practical. I do it.
aartaka has quit [Ping timeout: 260 seconds]
<beach> nij: That definition makes perfect sense in that it uses the meaning of well defined operators, so it's ideal that way. But it is not operational for the reason I mentioned. It is the purpose of bootstrapping to make it operational.
rumbler31 has quit [Remote host closed the connection]
<beach> nij: The code would have been much less understandable if I had used some specific notation for something that can be perfectly well notated with DEFCLASS.
nicktick has joined #lisp
<jackdaniel> n.b that's one of many reasons why programmer is not allowed to redefine operators in cl package (that is - the package is locked)
rumbler31 has joined #lisp
charles` has quit [Ping timeout: 244 seconds]
<_death> defmacro defmacro
OlCe has joined #lisp
luni has joined #lisp
<jackdaniel> (defmacro defmacro (&rest args) (cerror "Are you sure?") (error "Macros are bad for you"))
<nij> lol
<edgar-rft> my all-time favourite is (defum -_- nil 'zzZZ) so you can do (-_-) => zzZZ
frodef has joined #lisp
<nij> LOL
<nij> (just did it)
<edgar-rft> *defun of course
<nij> Any way that I can inspect the symbol 'car, fully?
<_death> (handler-bind ((sb-ext:symbol-package-locked-error #'continue)) (defun () () ())) ... (()) => ()
<nij> (special-operator-p 'car) => NIL .. this only reveals 'car's normal aspect.
theothor` has joined #lisp
<nij> In the source of #'special-operator-p there's a function #'info, but I cannot call it.
<nij> (Ah.. of course cuz it is sb-impl::info .. sorry for that)
<phoe> nij: what do you mean, inspect
<phoe> CAR names a function in the CL package
<phoe> that's what CL:DESCRIBE and CL:INSPECT will tell you
<nij> To see what 'car really contains, in particular, i want to see a piece of it as a specop.
<jackdaniel> nij: the operator you are looking for is: (defun magical-p (symbol) (eq (find-package 'cl) (symbol-package symbol)))
<phoe> that's an implementation detail
<nij> but as we saw car is not only a function
<phoe> what jackdaniel said.
<phoe> if the symbol is from the CL package, then it is magical.
<jackdaniel> there are more magical packages surely, like sicl's primop package, but you know the drill
<phoe> you seem to be going in circles
sjl has joined #lisp
<Bike> nij, i don't think you've really absorbed that there is NO CONFORMING WAY to see car as anything other than a function.
pankajsg has quit [Remote host closed the connection]
theothor` has quit [Ping timeout: 246 seconds]
sauvin_ has joined #lisp
<Bike> you cannot construct a conforming program in which the fact sbcl does compiler transformations sometimes is relevant. In a way that's the entire point of compiler transformations.
tassleoff has joined #lisp
<nij> Bike: I fail to understand..
<nij> (these two sentences)
<phoe> "but as we saw car is not only a function"
<phoe> for all conforming Lisp code, it IS only a function
<phoe> everything else is an implementation detail.
sauvin has quit [Ping timeout: 240 seconds]
JohnMS has joined #lisp
<jackdaniel> I don't want to spoil the fun for you, but it may be even implemented as a C function :_)
<phoe> in a way, that's where it stops being #lisp and starts being #sbcl or #ccl or #ecl or wherever else
<nij> phoe: correct.
gaqwas has joined #lisp
gaqwas has quit [Changing host]
gaqwas has joined #lisp
<nij> jackdaniel: i'm fine with that too.
<Bike> if you want to get into sbcl guts, you'll need to find a corresponding source-transformation, ir1 transform, or ir2 transform. there are a few functions that approximate getting at them but nothing that's easy to use since it's all sbcl guts. if you just do M-. in slime it'll usually pop up that stuff.
<Bike> for car in particular you want the source transform in srctran.lisp, and then if that fails it goes to the ir2 convert in generic/vm-macs.lisp which is hard to get details on because it's a "reffer" into a primitive structure.
<Bike> a ref. whatever
<Bike> this is in addition to other transforms and things that can sometimes elide calls to the car function that are spread throughout the system.
pankajsg has joined #lisp
theothor` has joined #lisp
<nij> (@_@)
theothor` has quit [Ping timeout: 256 seconds]
nicktick has quit [Ping timeout: 264 seconds]
theothornhill has quit [Ping timeout: 256 seconds]
luni has quit [Quit: Connection closed]
aeth_ has joined #lisp
Anonymous_ has quit [Ping timeout: 260 seconds]
Anonymous_ has joined #lisp
aeth has quit [Ping timeout: 264 seconds]
aeth_ is now known as aeth
theothor` has joined #lisp
JohnMS is now known as JohnMS_AWAY
wsinatra has joined #lisp
whatever1eek has joined #lisp
luni has joined #lisp
theothor` has quit [Ping timeout: 264 seconds]
whatever1eek is now known as purefunction
purefunction has quit [Quit: leaving]
andreyorst` has quit [Quit: andreyorst`]
JohnMS_AWAY is now known as JohnMS
galex-713 has joined #lisp
aartaka_d has quit [Ping timeout: 272 seconds]
theothor` has joined #lisp
orivej has joined #lisp
nij has quit [Quit: ERC (IRC client for Emacs 27.1)]
VincentVega has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.3)]
theothor` has quit [Ping timeout: 264 seconds]
Aurora_iz_kosmos is now known as Aurora_v_kosmose
rogersm has joined #lisp
aartaka has joined #lisp
rumbler31_ has joined #lisp
andreyorst has joined #lisp
luni has quit [Quit: Connection closed]
theothor` has joined #lisp
imode has joined #lisp
jonatack has joined #lisp
drbluefall has quit [Remote host closed the connection]
ggoes has joined #lisp
jonatack has quit [Ping timeout: 246 seconds]
jonatack has joined #lisp
theothor` has quit [Ping timeout: 240 seconds]
lithp has joined #lisp
jonatack has quit [Client Quit]
VincentVega has quit [Quit: Connection closed]
jonatack has joined #lisp
dbotton has joined #lisp
theothor` has joined #lisp
Stanley00 has joined #lisp
jonatack has quit [Ping timeout: 240 seconds]
OlCe has quit [Ping timeout: 260 seconds]
jonatack has joined #lisp
theothor` has quit [Ping timeout: 265 seconds]
remby has joined #lisp
Stanley00 has quit [Ping timeout: 260 seconds]
OlCe has joined #lisp
liberliver has quit [Quit: liberliver]
jeosol has joined #lisp
remby has left #lisp ["Good Bye"]
epony has quit [Ping timeout: 240 seconds]
rogersm has quit [Remote host closed the connection]
Wezl has quit [Ping timeout: 264 seconds]
theothor` has joined #lisp
rogersm has joined #lisp
hnOsmium0001 has joined #lisp
theothor` has quit [Ping timeout: 256 seconds]
Wezl has joined #lisp
avicenna has quit [Read error: Connection reset by peer]
avicenna has joined #lisp
jlpeters has quit [Read error: Connection reset by peer]
drmeister has quit [Read error: Connection reset by peer]
jlpeters has joined #lisp
drmeister has joined #lisp
wsinatra_ has joined #lisp
heisig has quit [Quit: Leaving]
wsinatra has quit [Read error: Connection reset by peer]
h4ck3r9696 has joined #lisp
theothor` has joined #lisp
vegansbane69 has quit [Ping timeout: 256 seconds]
theothor` has quit [Ping timeout: 240 seconds]
dbotton has quit [Quit: This computer has gone to sleep]
aeth_ has joined #lisp
aeth__ has joined #lisp
aeth has quit [Disconnected by services]
aeth__ is now known as aeth
cage__ has joined #lisp
sauvin__ has joined #lisp
theothor` has joined #lisp
pankajsg has quit [Remote host closed the connection]
sauvin_ has quit [Read error: Connection reset by peer]
xanderle has quit [Ping timeout: 256 seconds]
amerlyq has quit [Ping timeout: 256 seconds]
xanderle_ has joined #lisp
pankajsg has joined #lisp
amerlyq has joined #lisp
IPmonger has quit [Quit: ZNC 1.7.5+deb4 - https://znc.in]
orivej has quit [Ping timeout: 256 seconds]
cage_ has quit [Ping timeout: 256 seconds]
bilegeek has joined #lisp
orivej has joined #lisp
aeth_ has quit [Ping timeout: 256 seconds]
IPmonger has joined #lisp
theothor` has quit [Ping timeout: 265 seconds]
epony has joined #lisp
epony has quit [Remote host closed the connection]
Major_Biscuit has quit [Ping timeout: 240 seconds]
nwoob has joined #lisp
lowryder has quit [Ping timeout: 260 seconds]
theothor` has joined #lisp
lowryder has joined #lisp
theothor` has quit [Ping timeout: 246 seconds]
theothor` has joined #lisp
epony has joined #lisp
euandreh has quit [Ping timeout: 264 seconds]
theothor` has quit [Ping timeout: 264 seconds]
euandreh has joined #lisp
<nwoob> I'm writing code in .lisp file (mapcar #'add1 '(1 3 5 7 9))
<nwoob> how do I print the values returned by mapcar
paulj` has joined #lisp
paulj has quit [Ping timeout: 260 seconds]
<nwoob> I tried to do (setf data (mapcar #'add1 '(1 3 5 7 9))) and then (data)
<jackdaniel> hurrey, alpha-blended dashed path via xrender in McCLIM :) https://files.mastodon.social/media_attachments/files/105/634/554/978/109/689/original/cc3bbb1a7ed936b6.png
<nwoob> but it saya undefined function: data
<Wezl> nwoob: you can print with #'print : (print (mapcar #'add1 '(1 3 5 7 9)))
<Wezl> or using format
<nwoob> Wezl: how to save data returned by mapcar in another variable?
<Wezl> nwoob: (setf variable (mapcar ...))
<Wezl> but you access it without parentheses: (print variable) instead of (print (variable))
<nwoob> oh right, i was accessing data with parentheses
<nwoob> thanks Wezl
<amerlyq> Hello, today I have two more questions on forms evaluations ;) 1) what will (defun f () (a) (b) (a)) will do if we replace
<amerlyq> ... if we replace (a) when (b) is executed
theothor` has joined #lisp
<amerlyq> I expect (a) will keep previous value because stack frame stores pointer to whole previous environment of (f) ?
<jackdaniel> amerlyq: I don't understand your question; I think that you could gain more insightful feedback if you put more effort in writing it
Jesin has quit [Quit: Leaving]
vegansbane69 has joined #lisp
<amerlyq> jackdaniel: It's not that I'm lazy, it simply is fuzzy in my head. Sorry. I will try to rephrase it.
<OlCe> amerlyq: Hi. I don't think so. But also depends on whether you're compiling a whole file or not.
<jackdaniel> my point is that it would be better if you first figure out what you are wondering about and then try to ask a precise question; that gives you a better chance of learning something
<Wezl> apparently a will change
<jackdaniel> whether a changes between calls or not depends on the inlining policy
<OlCe> amerlyq: If A is defined in the same file as F, and compiled at once (COMPILE-FILE),
<jackdaniel> it may be explicitly expressed with declarations if that matters
<amerlyq> Wezl: it's about concurrent execution and form replacement, not sequential
<jackdaniel> i.e (declare (notinline foo))
<OlCe> amerlyq: then the second (A) could refer to the top-level definition of A, as well as the first.
theothor` has quit [Ping timeout: 256 seconds]
<Wezl> oh sorry for my ignorance
<OlCe> amerlyq: This is specified as being implementation-defined by the standard.
<OlCe> amerlyq: Regardless of whether (A) was declared inlined or not.
<jackdaniel> OlCe: could you show the part of the standard which says that?
<OlCe> amerlyq: Then, if (A) is declared inlined, second call to A will be same as the first.
<OlCe> If you declare notinline, they will be different.
<OlCe> And if you don't declare anything, and are not in the COMPILE-FILE case, then it's up to the implementation.
paulj` has quit [Ping timeout: 264 seconds]
<OlCe> jackdaniel: Sure. Give me a moment.
<amerlyq> jackdaniel: so, I know, that (f) is executed in one thread, and we try to replace (a) from another thread. Current instruction pointer is at (b), so (a) was executed once already, and whole (f) is already on stack and captured pointer to environment, so further replacement of (a) must not have effect on current execution of rest of (f). But is it true?
<jackdaniel> OlCe: thanks, that part about "regardless of whether (A) was declared inlined or not"
Jesin has joined #lisp
<jackdaniel> amerlyq: common lisp standard does not talk about multithreading, so you are already in the unspecified territory
euandreh has quit [Ping timeout: 272 seconds]
<OlCe> jackdaniel: It's in 3.2.2.3. But I recalled incorrectly it seems...
<OlCe> jackdaniel: "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."
JohnMS is now known as JohnMS_AWAY
<jackdaniel> and whether environment capture, I don't think that there is such term in common lisp either - I doubt that environment is stack-allocated in case of global functions
<OlCe> jackdaniel: So NOTINLINE blocks this behavior. And there is no real guarantee if there are runtime redefinitions.
<jackdaniel> ah, that's what you've meant. I thought that you speak that inline/notinline declarations are ignored
<amerlyq> OlCe: if "second (A) could refer to top-level" after compile time -- does it mean all symbols were resolved in compile time?
<OlCe> jackdaniel: Although I would bet that, in practice, (F) calls the initial version of (A) in this case. But again, no guarantees about stable behavior.
<OlCe> amerlyq: Yes.
euandreh has joined #lisp
<OlCe> jackdaniel: Yes, I meant, whether there is an INLINE declaration or not (but not including the NOTINLINE case).
<OlCe> Although it's not very clear, I interpret that an INLINE declaration on A would still give undefined behavior when using COMPILE-FILE.
<amerlyq> Hm, ok. So we may expect CL still using old (A) until (f) ends. But it's not guaranteed :D
<OlCe> In other words, I think that "The consequences are unspecified if functions are redefined individually at run time or multiply defined in the same file." also applies when A is declared INLINE. But that's debatable I guess.
<OlCe> amerlyq: Yes, it seems. But, on the contrary, if you use NOTINLINE, then you know the new A will be used for the second call.
<Bike> the compile-file restrictions are basically to allow the compiler to know things about functions in the same file so it can run analyses and possibly make calls simpler. it's left vague so that the compiler can choose not to do that.
<OlCe> Bike: Exactly.
theothor` has joined #lisp
mindCrime_ has joined #lisp
euandreh has quit [Ping timeout: 272 seconds]
<OlCe> amerlyq: All-in-all, it would be much better to avoid this kind of manipulation altogether...
euandreh has joined #lisp
nij has joined #lisp
aeth_ has joined #lisp
<amerlyq> OlCe: but isn't it exactly what I get if I run event loop in some program AND edit it in emacs at the same time? So... otherwise I must deinitialize whole program to clear stacks, to avoid this problem.
charles` has joined #lisp
JohnMS_AWAY is now known as JohnMS
<amerlyq> Or do you really -stop- program each time you wish to evaluate something?
theothor` has quit [Ping timeout: 272 seconds]
nij has left #lisp [#lisp]
aeth has quit [Ping timeout: 264 seconds]
<phoe> what do you mean, "stop" program?
<phoe> you mean a thread? all threads?
<amerlyq> basically, deinit every allocated state on each stack of each thread
<phoe> this depends on how the implementation refers to a function
<amerlyq> Hm, please elaborate
<amerlyq> In example above (defun f () (a) (b) (a)) I expect (f) refers to (a) by symbol name
<amerlyq> So on one hand it must resolve (a) to last evaluated implementation
<Bike> if you want a redefinition of A to affect a loop in another thread, you can declare A notinline and it will probably work.
JohnMS has quit [Quit: Konversation terminated!]
<phoe> I assume it will work the same if you compile the whole file instead of going full REPL
<amerlyq> phoe: sorry, some more context from above: we replace (a) from another thread, when (f) is currently running on stack (and evaluating (b) at the moment) directly before 2nd (a)
rogersm has quit [Quit: Leaving...]
<phoe> that's the same stuff though
theothor` has joined #lisp
<phoe> B can execute (sleep 60) and then we have another thread to replace A
<phoe> one second...
<amerlyq> what you wrote in listing -- is replacing (a) from the same thread (i.e. environment), so of course (a) in this case will be redefined
<amerlyq> but I seen somewhere explanation about each thread stack stores pointers to environment to allow executing previous versions of functions when stack is unwinded
pfdietz40 has quit [Quit: Ping timeout (120 seconds)]
<phoe> that must not always be the case, because my SBCL does not behave this way
jeosol has quit [Quit: Ping timeout (120 seconds)]
<phoe> again, this is implementation-dependent territory
mindCrime_ has quit [Ping timeout: 240 seconds]
<phoe> but I do wonder if this behaves any other way on any other implementation under default optimization settings
<phoe> and without any inline or notinline proclaimed
<amerlyq> hm, convincing example for sbcl at least, thanks.
dbotton has joined #lisp
theothor` has quit [Remote host closed the connection]
aeth_ is now known as aeth
<phoe> CCL does the same thing
<amerlyq> But it means if I use resources (defun f () (unwind-protect (init-A) ... (deinit-A)) I still can't replace deinit-A until (f) is completed, or I will have bug
Stanley00 has joined #lisp
<phoe> are you sure?
<amerlyq> But you demonstrated it?
bitmapper has quit [Quit: Connection closed for inactivity]
<amerlyq> "can't replace" -- I'm not allowed to, I meant
nwoob has left #lisp ["rcirc on GNU Emacs 26.3"]
<phoe> why are you not allowed to?
mindCrime_ has joined #lisp
<amerlyq> In my workflow I have both (init-A) and (deinit-A) together in file. I edit them symmetrically when needed and reload. But if event loop in another thread already called previous version of (init-A), then after ending event processing it will call new (deinit-A), which is wrong.
phantomics has quit [Quit: Ex-Chat]
Stanley00 has quit [Ping timeout: 246 seconds]
<phoe> did you proclaim deinit-a notinline?
<amerlyq> nope
<phoe> try doing that and recompile
<Bike> if i understand amerlyq's problem correctly, it's that deinit-a is being redefined AFTER init-a is called but BEFORE deinit-a is called, and the new deinit-a is inappropriate for undoing the consequences of init-a.
<Alfr> amerlyq, do you actually expect it to call the old version? That's just sick.
<phoe> Bike: oooh. That's a whole another problem.
<Bike> so actually in this instance, amerlyq wants the old deinit-a.
<Bike> yes. i think this requires more synchronization than an implementation could provide without some input.
<Bike> how is it supposed to know that init-a and deinit-a work like this?
waleee-cl has quit [Quit: Connection closed for inactivity]
<phoe> I know that Erlang has this sort of modularity in place, it supports live-reloading module by module, and a module contains multiple functions at the same time
<phoe> but Lisp has no such primitives
Wezl has left #lisp ["boredom"]
<amerlyq> I was able to found where I read mention about "multiple environment model" https://www.reddit.com/r/Common_Lisp/comments/9q6bum/how_does_common_lisp_implement_hot_code_reloading/
<charles`> phoe: ...yet!
<amerlyq> >> Each stack frame has its own environment frame, which allows you to "go back in time" and evaluate code in the context of a particular stack frame
<phoe> that's a different thing
<phoe> eval-in-frame likely refers to dynamic context rather than an old version of the dynamic environment
<phoe> uh I mean
<phoe> eval-in-frame likely refers to dynamic context rather than an old version of the global environment
<Bike> i think this question is overestimating sbcl
<Bike> "It seems that in some way the LISP compiler updates also the call stack. " i don't think this is actually true.
<phoe> this is one way to always call the old function
<phoe> but it requires the calling code to be prepared for such redefinitions, and still doesn't have any synchronization so is prone to race conditions
<amerlyq> yes, it quickly becomes rather noisy and ugly :(
<Bike> i don't understand how you could accomplish both allowing threads to see redefinitions from other threads, and making sure they see all redefinitions in a module at once, with preemptive multitasking?
<Bike> i mean, doing multiple redefinitions is probably not an atomic operation
<Bike> i guess you could like check a flag before any function call, kind of thing
<phoe> I mean, you theoretically could
<phoe> you can atomically replace an environment with another one
<phoe> but that's already SICL zone
<phoe> with its multiple global environments and such
<Bike> i guess that's the same kind of thing as tripping a flag.
<phoe> yes
<amerlyq> if we combine init and deinit under single class, will instance use old or new deinit?
<phoe> what do you mean, under single class
<Bike> that is not how methods are organized in lisp. functions exist in themselves, they are not part of or under any class.
<phoe> in Lisp methods belong to GFs, not to classes
<Bike> now, if you had like, (init object) and (deinit object), the choice of what method to call is delayed until the actual call, so if you redefined deinit it could work.
<amerlyq> So, instances call methods too by name, and not by pointer (in which case instance would have still old ptr)
<amerlyq> ?
<Bike> instances do not hold any reference to methods.
<Bike> instances do not call anything.
<amerlyq> so... no workaround
<Bike> not particularly, no. generic functions work like any other function in this sense.
<amerlyq> then, what is general workflow to mitigate such problems in your development? Do you really must reinit whole image when you with to replace some init-deinit pair?
<amerlyq> *wish
<Bike> I don't think I have ever run into this particular problem. If I did, I would probably stop the loop and redefine things, yes. If I really wanted to keep the process going I'd probably do something like what phoe wrote, maybe hidden by macros.
anticrisis has joined #lisp
<amerlyq> Bike: What about global state stored outside of loop? What if it still contains instances of old classes you changed? Will you try to transfer state somehow (assuming it was long to load/evaluate) or will ditch it too?
vegansbane69 has quit [Ping timeout: 256 seconds]
<Bike> instances of classes that are redefined actually do get lazily updated to match the new definition.
<OlCe> amerlyq: If you want to keep init-A and deinit-A in sync, a simpler way is to redefine the caller of them. It it's an event loop, then you should arrange for a way out of the loop after the caller's redefinition, and call again the caller.
<OlCe> amerlyq: If not, you're going to have to hack the new version of deinit-A so that it runs the old code only if init-A has been called, which you may not be able to determine without a new version of init-A anyway.
<OlCe> amerlyq: And I'm not even talking about multi-thread synchro here.
<phoe> you could, in theory, grab the old fdefinitions though
<amerlyq> Bike: Hm. Lazy update... (defclass Pt (x y)) -> (defclass Pt (a b)). After dropping x,y -- who will init values a,b , if their init was before the loop -- and therefore never called again?
<phoe> and close the new fdefinitions over the old ones.
<phoe> and conditionally call the new or old one
<amerlyq> OlCe: even if you redefine caller -- you still must redefine inidividual init/deinit -- and will still get inconsistency. Otherwise -- you must inline them for your approach to work
<Bike> amerlyq: instances are updated at latest the next time you try to access one of their slots. so, if you then tried to access the A slot of a point, it would be updated, which means the value of the x slot would be dropped and the value of the A slot would be initialized from the initforms, and then the read of the a slot would complete and return that initialized value.
<OlCe> amerlyq: Not necessarily, if your redefine the caller, you can substitute the calls to init-A' and deinit-A'.
<amerlyq> OlCe: hm, manual versioning of functions... what a mess :D))
<amerlyq> Bike: and so, "A" slot will contain "default value" instead of expected values from "init" accompanying the "Pt" class. In demo of particles it will look like abrupt jump of all points to the (0,0) in the moment of reload.
<OlCe> amerlyq: Yes. But even for that you can do better.
<OlCe> amerlyq: You can use instead dynamic vars and funcall.
<OlCe> This way you just change the bindings to call the new versions of init-A and deinit-A in the new version only.
<Bike> amerlyq: the instance updater doesn't know anything about your "init" function, no. You can however actually customize the updater to call your init method or whatever.
orivej has quit [Ping timeout: 240 seconds]
<amerlyq> OlCe: thanks for the idea, batch-renaming functions by adding incremental sfx will allow somewhat atomic dirty replacement (still GC is crying).
<amerlyq> dynvars and funcall looks like the way -- not "generic", but at least for some functions which I replace the most often.
condemnedferret has joined #lisp
<amerlyq> Bike: I read above as "don't rely on lazy init and better manually reinitialize everything, however long it takes"
<Bike> does changing the lazy init to do whatever you want not work?
ft has quit [Ping timeout: 260 seconds]
sauvin__ is now known as Sauvin
aindilis has quit [Remote host closed the connection]
<amerlyq> again example with particles simulation -- generally you expect to have some initial distribution -- so you have generator which creates batch of points with specific (x,y) based on its parameters. If you wrap this generator to generate single i-th point and provide it to lazy init -- you will "hardcode" generator parameters
ciaranb has joined #lisp
<amerlyq> Bike: so its not impossible, but complexity grows like mushrooms after the rain
<Bike> Maybe I wasn't clear. The updater can look at the instance pre-update. You could for example assign A to have the old X value and B to have the old Y value.
<Bike> But you were phrasing things in terms of an (init) call so I thought that was what you wanted.
<Alfr> amerlyq, you could make your init-a return a corresponding deinit-a which the user of init-a shall call later.
<amerlyq> Slightly convoluted example (I know): changing Pt(x,y) -> Pt(a,b) may signify you worked with geometric plane and wish to try working with phase plane (s,v) now (and still keep all previous program state). In this case there is no direct conversion (x,y) -> (a,b) and you must get new (a,b) values somewhere. Still let's stop, I know I must simply create PPt class instead :)
<amerlyq> Alfr: Oh, nice next step of the idea
<Bike> i kind of want to know how this is supposed to work. i mean if there's no correspondence between the old and new points, what does "updating" even mean?
<Alfr> amerlyq, but I'm unsure how nice it plays along w/ unwind-protect.
<Bike> i don't think that would pose a problem for unwind-protect
<Bike> I guess you could do something like call a function that returns both an initializer and deinitializer, then calls the initializer, then does whatever work, then calls the deinitializer. and then wrap it in a macro so you just write (with-a ... do work ...)
<Alfr> Bike, ah ... a third function does the trick. :)
cage__ has quit [Quit: Leaving]
cage__ has joined #lisp
cage__ has quit [Client Quit]
Sauvin has quit [Remote host closed the connection]
dyelar has quit [Quit: Leaving.]
lithp has quit [Ping timeout: 256 seconds]
<amerlyq> Bike: I had a mess of example, sorry. Emphasis was, that when you -add- new field -- it's often dependent on smth outside instance, so you can't lazy-init to generate proper value for that field
<Bike> sure. in that case you'd probably have to do something more global, yeah. which i guess would involve pausing.
Cymew has quit [Ping timeout: 240 seconds]
vegansbane69 has joined #lisp
aindilis has joined #lisp
wsinatra has joined #lisp
wsinatra_ has quit [Ping timeout: 240 seconds]
ft has joined #lisp
condemnedferret has quit [Quit: Quit]
andreyorst has quit [Ping timeout: 240 seconds]
frodef` has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
frodef has quit [Ping timeout: 246 seconds]
ebrasca has quit [Remote host closed the connection]
wsinatra has quit [Ping timeout: 240 seconds]
wsinatra has joined #lisp
amerlyq has quit [Quit: amerlyq]
ukari has quit [Remote host closed the connection]
frodef` has quit [Ping timeout: 240 seconds]
frodef`` has joined #lisp
waleee-cl has joined #lisp
Stanley00 has joined #lisp
Stanley00 has quit [Ping timeout: 260 seconds]
Lycurgus has joined #lisp
Jesin has quit [Quit: Leaving]
elflng has quit [Quit: Lost terminal]
Stanley00 has joined #lisp
enzuru has quit [Ping timeout: 264 seconds]
Stanley00 has quit [Ping timeout: 272 seconds]
h4ck3r9696 has quit [Ping timeout: 264 seconds]
<phoe> OK, #lisp, I have a fairly important question
<Xach> with a preface like that
<phoe> What sorts of fixes, corrections, revisions, additions, tricks, recipes, informations, would you like to see in the second edition of Common Lisp Recipes?
<phoe> that's a long-term question, so answers don't need to come today or even this month
<Xach> i preordered Common Lisp Recipes in 2015. between my preorder and the actual release, i moved to a new place. the book was delivered to my old house. the new owners kept it! i have never read it!
<Xach> i will have to read it before i can comment, sorry
<phoe> please do!
<mfiano> Who's asking, you or Edi?
<phoe> mfiano: me
<Lycurgus> are there two?
<phoe> Lycurgus: wait, what two?
<Lycurgus> edi weitz's and somebody else's?
<phoe> huh? there's only Edi's CLR, first edition
<phoe> but there might be a second one.
<Lycurgus> ah, OK, I implied that since you were asking you were the author
<mfiano> There is one thing lacking from every CL book that I'd like to see.
<phoe> nope, I'm not the author - but I might be involved in the second edition
<phoe> hence my question
<Lycurgus> i c
<phoe> mfiano: what is it?
<mfiano> A recipe for getting set up with a proper environment so we can direct people insisting on MS Notepad without SLIME/Sly over to it.
<phoe> yes
<phoe> I will certainly want to have a whole initial section dedicated to emacs, vim, sublime, atom, and vscode along with their respective Lisp environments
<phoe> because this stuff is *absolutely* important in my opinion
<_death> I couldn't bear to finish CLR.. every page had footnotes, which are not useful when reading front to back, and my compulsion forces me to read them.. too painful
scymtym_ has joined #lisp
<_death> but it seems Xach has devised a new method of bringing people into CL
scymtym has quit [Ping timeout: 260 seconds]
<phoe> hm?
<_death> move fast and preorder things
<phoe> ...
<phoe> Yes
<Xach> this technique works especially well when ordering used books that ship very slowly
elflng has joined #lisp
dbotton has quit [Quit: This computer has gone to sleep]
narimiran has quit [Ping timeout: 240 seconds]
Wezl has joined #lisp
aartaka has quit [Ping timeout: 264 seconds]
pfdietz has joined #lisp
wsinatra has quit [Ping timeout: 272 seconds]
karlosz has joined #lisp
ciaranb has quit [Quit: Connection closed]
enzuru has joined #lisp
v3ga has quit [Ping timeout: 272 seconds]
jerme_ has quit [Ping timeout: 260 seconds]
banjiewen__ has quit [Ping timeout: 260 seconds]
v3ga has joined #lisp
jerme_ has joined #lisp
banjiewen__ has joined #lisp
dbotton has joined #lisp
ikrabbe has quit [Ping timeout: 246 seconds]
phantomics has joined #lisp
Lycurgus has quit [Quit: Exeunt]
shka_ has quit [Ping timeout: 264 seconds]
caret has quit [Quit: Leaving]
OlCe has quit [Ping timeout: 256 seconds]
mindCrime_ has quit [Ping timeout: 264 seconds]
mindCrime_ has joined #lisp
luni has joined #lisp
jeosol has joined #lisp
luni has quit [Quit: Connection closed]
vegansbane69 has quit [Ping timeout: 256 seconds]
OlCe has joined #lisp
ikrabbe has joined #lisp
dbotton has quit [Quit: This computer has gone to sleep]
Stanley00 has joined #lisp
tassleoff has quit [Ping timeout: 260 seconds]
secretmyth has joined #lisp
Stanley00 has quit [Ping timeout: 240 seconds]
dbotton has joined #lisp
Wezl has quit [Ping timeout: 272 seconds]
stux|RC has quit [Quit: Aloha!]
secretmyth has quit [Quit: Leaving]
stux|RC has joined #lisp
Wezl has joined #lisp
frodef`` has quit [Ping timeout: 240 seconds]
hjudt has quit [Ping timeout: 265 seconds]
dbotton has quit [Quit: This computer has gone to sleep]
vegansbane69 has joined #lisp
dbotton has joined #lisp
torbo has joined #lisp
random-nick has quit [Ping timeout: 265 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
zaxo has joined #lisp
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
sjl has quit [Ping timeout: 256 seconds]
surabax has quit [Quit: Leaving]
jackdani1l has joined #lisp
jackdaniel has quit [Ping timeout: 240 seconds]
hvxgr has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
OlCe has quit [Ping timeout: 260 seconds]
igemnace has joined #lisp
pillton has joined #lisp
aindilis has quit [Ping timeout: 264 seconds]
aindilis has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
pve has quit [Quit: leaving]
aindilis has quit [Remote host closed the connection]
aindilis` has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
dim has quit [Quit: ZNC - http://znc.sourceforge.net]
amb007 has joined #lisp
aindilis` has quit [Remote host closed the connection]
dim has joined #lisp
frodef has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
aindilis has joined #lisp
Wezl has quit [Ping timeout: 264 seconds]
theruran has quit [Ping timeout: 246 seconds]
gendl has quit [Ping timeout: 260 seconds]
hnOsmium0001 has quit [Read error: Connection reset by peer]
jmercouris has quit [Ping timeout: 264 seconds]
selwyn has quit [Ping timeout: 264 seconds]
selwyn has joined #lisp
theruran has joined #lisp
mpontillo has quit [Ping timeout: 260 seconds]
jmercouris has joined #lisp
mpontillo_ has joined #lisp
Wezl has joined #lisp
gendl has joined #lisp
hnOsmium0001 has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
euandreh has quit [Ping timeout: 240 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
Codaraxis has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
renzhi has joined #lisp