jackdaniel changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.5.4, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
lucasb has quit [Quit: Connection closed for inactivity]
vms14 has quit [Quit: WeeChat 2.3]
Kundry_Wag has joined #lisp
karlosz has joined #lisp
Kundry_Wag has quit [Ping timeout: 248 seconds]
wxie has joined #lisp
karlosz has quit [Quit: karlosz]
karlosz has joined #lisp
karlosz has quit [Quit: karlosz]
cl-arthur has quit [Remote host closed the connection]
semz has quit [Ping timeout: 264 seconds]
nanoz has joined #lisp
t58 has quit [Quit: Night]
nanoz has quit [Quit: Leaving]
nanoz has joined #lisp
semz has joined #lisp
semz has quit [Changing host]
semz has joined #lisp
Aruseus has quit [Remote host closed the connection]
saravia has quit [Remote host closed the connection]
lavaflow has quit [Ping timeout: 246 seconds]
lavaflow has joined #lisp
nullman has quit [Ping timeout: 245 seconds]
nullman has joined #lisp
trebor_home has quit [Ping timeout: 264 seconds]
wxie has quit [Quit: wxie]
wxie has joined #lisp
lavaflow has quit [Ping timeout: 245 seconds]
lavaflow_ has joined #lisp
Ricchi has joined #lisp
Blukunfando has quit [Ping timeout: 272 seconds]
wxie has quit [Ping timeout: 264 seconds]
Insanity_ has quit [Quit: Connection closed for inactivity]
_whitelogger has joined #lisp
Kundry_Wag has joined #lisp
wxie has joined #lisp
lavaflow_ has quit [Quit: WeeChat 2.4]
Kundry_Wag has quit [Ping timeout: 245 seconds]
EvW has quit [Ping timeout: 250 seconds]
akoana has left #lisp [#lisp]
borracciaBlu has joined #lisp
borracciaBlu has quit [Ping timeout: 258 seconds]
wxie has quit [Ping timeout: 245 seconds]
wxie has joined #lisp
<beach> Good morning everyone!
<LdBeth> Hello beach
Bike has quit [Quit: Lost terminal]
dddddd has quit [Remote host closed the connection]
borracciaBlu has joined #lisp
dkrm has quit [Ping timeout: 250 seconds]
borracciaBlu has quit [Ping timeout: 244 seconds]
Jeanne-Kamikaze has quit [Quit: Leaving]
nanozz has joined #lisp
borracciaBlu has joined #lisp
nanoz has quit [Ping timeout: 248 seconds]
wxie has quit [Ping timeout: 248 seconds]
gravicappa has joined #lisp
urqL has joined #lisp
borracciaBlu has quit [Client Quit]
urqL has quit [Read error: Connection reset by peer]
lemoinem has quit [Ping timeout: 272 seconds]
lemoinem has joined #lisp
notzmv has quit [Ping timeout: 245 seconds]
sauvin has joined #lisp
manualcrank has quit [Quit: WeeChat 1.9.1]
Kundry_Wag has joined #lisp
_whitelogger has joined #lisp
wigust has quit [Ping timeout: 245 seconds]
wigust has joined #lisp
ggole has joined #lisp
<ober> hi
<beach> Hello ober.
orivej has joined #lisp
vlatkoB has joined #lisp
_whitelogger has joined #lisp
trebor_home has joined #lisp
SaganMan has joined #lisp
vsync has quit [Ping timeout: 272 seconds]
vsync has joined #lisp
khisanth_ has quit [Ping timeout: 272 seconds]
gravicappa has quit [Ping timeout: 248 seconds]
khisanth_ has joined #lisp
trebor_home has quit [Ping timeout: 250 seconds]
orivej has quit [Ping timeout: 244 seconds]
dkrm has joined #lisp
nirved has joined #lisp
nirved has quit [Client Quit]
sonologico has joined #lisp
karlosz has joined #lisp
alca has quit [Ping timeout: 258 seconds]
slyrus has joined #lisp
alca has joined #lisp
karlosz has quit [Remote host closed the connection]
igemnace has quit [Ping timeout: 248 seconds]
nanozz has quit [Ping timeout: 245 seconds]
space_otter has joined #lisp
zaquest has quit [Read error: Connection reset by peer]
igemnace has joined #lisp
zaquest has joined #lisp
space_otter has quit [Quit: Leaving]
zotan has quit [Ping timeout: 272 seconds]
space_otter has joined #lisp
Kundry_Wag has joined #lisp
zotan has joined #lisp
space_otter has quit [Remote host closed the connection]
ravenous_ has joined #lisp
Kundry_Wag has quit [Ping timeout: 248 seconds]
space_otter has joined #lisp
space_otter has quit [Client Quit]
space_otter has joined #lisp
Ven`` has joined #lisp
space_otter has quit [Remote host closed the connection]
trebor_home has joined #lisp
Lord_of_Life has quit [Ping timeout: 244 seconds]
t58 has joined #lisp
Lord_of_Life has joined #lisp
datajerk has quit [Ping timeout: 248 seconds]
datajerk has joined #lisp
nanoz has joined #lisp
_whitelogger has joined #lisp
random-nick has joined #lisp
_whitelogger has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bendersteed has joined #lisp
random-nick has quit [Ping timeout: 248 seconds]
SaganMan is now known as nsfw
nsfw is now known as SaganMan
random-nick has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
niceplace has quit [Quit: ZNC 1.7.3 - https://znc.in]
niceplace has joined #lisp
igemnace has quit [Quit: WeeChat 2.5]
trebor_home has quit [Ping timeout: 264 seconds]
Ricchi has quit [Remote host closed the connection]
cosimone has joined #lisp
bendersteed has quit [Remote host closed the connection]
bendersteed has joined #lisp
SaganMan has quit [Ping timeout: 245 seconds]
Inline has joined #lisp
ebrasca has joined #lisp
zotan has quit [Ping timeout: 250 seconds]
zotan has joined #lisp
hhdave has joined #lisp
zulu-inuoe__ has quit [Read error: Connection reset by peer]
Inline__ has joined #lisp
Inline__ has quit [Read error: Connection reset by peer]
Inline__ has joined #lisp
Inline has quit [Ping timeout: 264 seconds]
Inline__ is now known as Inline
dddddd has joined #lisp
faheem has quit [Ping timeout: 245 seconds]
PP has joined #lisp
SaganMan has joined #lisp
<PP> Hello. How do I do `(dotimes (i 10) (dotimes (j 10) (print (cons i j))))` equivalent in loop? I mean `(loop for i upto 10 for j upto 10` goes in parallel so to speak and doesn't give permutations
<ck_> PP: you mean, in one loop?
<PP> In one `loop` macro preferably, yea. I mean I could loop over `alexandria:map-product` but is that efficient?
<jackdaniel> it is not
<jackdaniel> it conses expoinentially
<jackdaniel> PP: wrt I'm afraid you need to (loop for i from 0 to 10 do (loop for j from 0 to 10 do (print (cons i j)))
<jackdaniel> or write your own macro (dotimes* ((i 10) (j 10)) …) based on whatever you like (i.e do or loop or dotimes)
<PP> ok, thank you very much!:-)
PP has left #lisp [#lisp]
faheem has joined #lisp
cosimone has quit [Quit: WeeChat 2.5]
manualcrank has joined #lisp
Kundry_Wag has joined #lisp
bendersteed has quit [Quit: bye]
<_death> BELOW, not TO
hhdave has quit [Quit: hhdave]
Kundry_Wag has quit [Ping timeout: 272 seconds]
makomo has joined #lisp
Bike has joined #lisp
wxie has joined #lisp
lnostdal has joined #lisp
makomo has quit [Quit: WeeChat 2.4]
cosimone has joined #lisp
Mandus has quit [Ping timeout: 268 seconds]
gravicappa has joined #lisp
Kundry_Wag has joined #lisp
Mandus has joined #lisp
EvW1 has joined #lisp
<jackdaniel> yes
random-nick has quit [Ping timeout: 246 seconds]
random-nickname has joined #lisp
wxie has quit [Ping timeout: 250 seconds]
GloriaReed has joined #lisp
twanny796 has joined #lisp
<p_l> Has anyone looked into implementing CommonQT using the SIP code generator from PyQt5?
random-nickname has quit [Ping timeout: 248 seconds]
random-nickname has joined #lisp
SaganMan has quit [Quit: WeeChat 1.6]
cosimone has quit [Quit: WeeChat 2.5]
gareppa has joined #lisp
Kundry_Wag has quit [Ping timeout: 244 seconds]
Ven`` has joined #lisp
cosimone has joined #lisp
adulteratedjedi is now known as gjnoonan
Kundry_Wag has joined #lisp
ravenous_ has quit [Read error: Connection reset by peer]
random-nickname is now known as random-nick
Kundry_Wag has quit [Ping timeout: 246 seconds]
ravenous_ has joined #lisp
GloriaReed has quit [Ping timeout: 268 seconds]
easye has quit [Remote host closed the connection]
easye has joined #lisp
DrDuck has joined #lisp
bendersteed has joined #lisp
lucasb has joined #lisp
nullniverse has quit [Remote host closed the connection]
nullniverse has joined #lisp
Ven`` has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cosimone has quit [Ping timeout: 264 seconds]
cosimone has joined #lisp
ravenous_ has quit [Read error: Connection reset by peer]
ravenous_ has joined #lisp
orivej has joined #lisp
pnp has joined #lisp
saravia has joined #lisp
bjorkintosh has quit [Ping timeout: 264 seconds]
bjorkintosh has joined #lisp
ravenous_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
EvW1 has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #lisp
gareppa has quit [Quit: Leaving]
anewuser has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
cosimone has quit [Ping timeout: 252 seconds]
cosimone has joined #lisp
Jeanne-Kamikaze has joined #lisp
Josh_2 has joined #lisp
<Josh_2> Got a physical copy of A programmers guide to ClOS Sonja Keene in the post today :P
orivej has joined #lisp
<Inline> welp, OOP is hard
<pnp> for deep reading a book is better
<Inline> understanding the machinery is a thing but modeling your domain is another thing....
<Inline> there are so many variation possibilities....it's kinda parametric
<Inline> hard to get my head around, how to start etc....
<pnp> goodbye OOP... someone thinks it's old style
<Josh_2> Theres a digital copy that I have but It's not very good quality, looks like someone did a bad job scanning the book into a digital format
<Inline> is oop referentially transparent ?
<djeis[m]> There's nothing enforcing referential transparency, but there's nothing stopping it either.
<djeis[m]> It's not exactly common in most codebases tho, from what I've seen.
Kundry_Wag has joined #lisp
cosimone has quit [Ping timeout: 245 seconds]
cosimone has joined #lisp
Kundry_Wag has quit [Ping timeout: 245 seconds]
orivej has quit [Ping timeout: 272 seconds]
anewuser has quit [Ping timeout: 246 seconds]
cosimone has quit [Ping timeout: 252 seconds]
cosimone has joined #lisp
<moldybits> Josh_2: is that a different book? i thought it was Object-Oriented Programming in Common Lisp
<Josh_2> yah
<Josh_2> it is that
<moldybits> Ooh, pickle!
pnp has left #lisp [#lisp]
trocado has joined #lisp
cosimone has quit [Quit: WeeChat 2.5]
nanoz has quit [Ping timeout: 244 seconds]
trocado has quit [Ping timeout: 272 seconds]
Blkt has quit [Quit: No Ping reply in 180 seconds.]
Blkt has joined #lisp
fe[nl]ix has quit [Read error: Connection reset by peer]
fe[nl]ix has joined #lisp
Lycurgus has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
fe[nl]ix has quit [Ping timeout: 252 seconds]
fe[nl]ix has joined #lisp
<mrcode_> is there a way to declare a type so that it maps to uint32_t to take advantage of a natural wrap-around once it goes beyond uint32_max ?
<Bike> type declarations don't influence semantics like that.
<Bike> however, if you wrap your arithmetic in logand the complier might take care of it (sbcl does, at least)
<mrcode_> thx Bike
<mrcode_> very useful. exactly what i was trying to find out
Ricchi has joined #lisp
cyberyl has joined #lisp
orivej has joined #lisp
X-Scale has quit [Quit: HydraIRC -> http://www.hydrairc.com <- Chicks dig it]
<mrcode_> what's a good idiomatic way to convert a list of character codes gathered during a loop collect (code-char ...) into a string type ?
Jeanne-Kamikaze has quit [Remote host closed the connection]
ebrasca has quit [Remote host closed the connection]
cartwright has joined #lisp
<Bike> (map 'string #'code-char list)
<Bike> or
<Bike> wait, so you have a list of characters or a list of codes?
<Bike> for the former just (coerce list 'string)
<mrcode_> i actually have a list of codes and with collect (code-char elem) i end up with a list of characters, but ultimately, i'd like a string
<mrcode_> i think (map 'string #'code-char list) does it for me
<mrcode_> thx again Bike
<Bike> glad to be of servic3
abhixec has joined #lisp
<_death> perhaps you could just use with-output-to-string, map-into with a string, or (setf aref)...
Theo_ has joined #lisp
_Theo_ has quit [Ping timeout: 245 seconds]
cartwright has quit [Remote host closed the connection]
_Theo_ has joined #lisp
cantstanya has joined #lisp
Theo_ has quit [Ping timeout: 250 seconds]
kajo has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 246 seconds]
Cymew has joined #lisp
Cymew has quit [Client Quit]
_Theo_ has quit [Quit: Leaving]
_Theo_ has joined #lisp
saravia has quit [Ping timeout: 258 seconds]
parab has joined #lisp
tankf33der has joined #lisp
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
gravicappa has quit [Ping timeout: 272 seconds]
dale has joined #lisp
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 272 seconds]
paul0 has quit [Read error: Connection reset by peer]
paul0 has joined #lisp
<dlowe> mrcode_: what encoding are you talking about here?
koenig has quit [Ping timeout: 245 seconds]
<dlowe> because unless it's ascii-only, iterating over the bytes will probably not do what you want
saravia has joined #lisp
Kundry_Wag has joined #lisp
saravia_ has joined #lisp
Aruseus has joined #lisp
Lycurgus has quit [Quit: Exeunt]
random-nickname has joined #lisp
random-nick has quit [Ping timeout: 245 seconds]
bjorkint0sh has joined #lisp
vlatkoB has quit [Remote host closed the connection]
bjorkintosh has quit [Ping timeout: 250 seconds]
saravia_ has quit [Remote host closed the connection]
EvW has joined #lisp
saravia_ has joined #lisp
saravia_ has quit [Remote host closed the connection]
froggey_ has joined #lisp
froggey has quit [Disconnected by services]
froggey_ is now known as froggey
random-nickname is now known as random-nick
ggole has quit [Quit: Leaving]
jmercouris has joined #lisp
Mandus has quit [Ping timeout: 258 seconds]
Mandus has joined #lisp
superkumasan has joined #lisp
parab has quit [Quit: parab]
parab has joined #lisp
techquila has joined #lisp
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 258 seconds]
Lord_of_Life_ is now known as Lord_of_Life
cyberyl has quit [Remote host closed the connection]
abhixec has quit [Ping timeout: 244 seconds]
gdsg has joined #lisp
Kundry_W_ has joined #lisp
saravia has quit [Remote host closed the connection]
<pjb> mrcode_: nope, CL only as ℤ, not ℤ/2ⁿ.
Kundry_W_ has quit [Ping timeout: 245 seconds]
alexanderbarbosa has joined #lisp
twanny796 has quit [Ping timeout: 245 seconds]
gigetoo has quit [Ping timeout: 244 seconds]
dale__ has joined #lisp
dale has quit [Disconnected by services]
dale__ is now known as dale
jonatack has quit [Quit: WeeChat 2.3]
jonatack has joined #lisp
alexanderbarbosa has quit [Remote host closed the connection]
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
saravia has joined #lisp
Kundry_Wag has quit [Ping timeout: 245 seconds]
Aruseus has quit [Remote host closed the connection]
permagreen has quit [Read error: Connection reset by peer]
permagreen has joined #lisp
permagreen has quit [Remote host closed the connection]
permagreen has joined #lisp
liberiga has joined #lisp
alexanderbarbosa has joined #lisp
alexanderbarbosa has quit [Remote host closed the connection]
cosimone has joined #lisp
alexanderbarbosa has joined #lisp
hhdave has joined #lisp
Jeanne-Kamikaze has joined #lisp
gigetoo has joined #lisp
jmercouris has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
nanoz has joined #lisp
Kundry_Wag has quit [Ping timeout: 258 seconds]
EvW has quit [Ping timeout: 250 seconds]
saravia has quit [Quit: Leaving]
Kundry_Wag has joined #lisp
<stylewarning> What do you mean “CL doesn’t have Z/2^n”?
<stylewarning> That doesn’t make much sense
Aruseus has joined #lisp
Kundry_Wag has quit [Ping timeout: 248 seconds]
<semz> Does shadowing a CL function via FLET etc conflict with the standard? If no, is there a way to disable the warnings for it?
techquila has quit [Remote host closed the connection]
saravia has joined #lisp
Jeanne-Kamikaze has quit [Remote host closed the connection]
nanoz has quit [Read error: Connection timed out]
nanoz has joined #lisp
nil has quit [Quit: Fairfarren.]
nil has joined #lisp
<|3b|> clhs 11.1.2.1.2
<specbot> Constraints on the COMMON-LISP Package for Conforming Programs: http://www.lispworks.com/reference/HyperSpec/Body/11_abab.htm
<|3b|> semz: ^ #2 specifically
cosimone has quit [Ping timeout: 252 seconds]
<|3b|> it could break macros (or special forms implemented as macros) or compiler macros that expect the official definitions, so not really a good idea anywayy
cosimone has joined #lisp
<semz> Makes sense.
Mandus has quit [Ping timeout: 258 seconds]
Mandus has joined #lisp
liberiga has quit [Ping timeout: 260 seconds]
saravia has quit [Quit: Leaving]
alexanderbarbosa has quit [Remote host closed the connection]
EvW has joined #lisp
cosimone has quit [Ping timeout: 264 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
Kundry_Wag has joined #lisp
jmc has joined #lisp
orivej has quit [Ping timeout: 245 seconds]
hhdave has quit [Quit: hhdave]
permagreen has quit [Remote host closed the connection]
jmc has quit [Remote host closed the connection]
nanoz has quit [Ping timeout: 245 seconds]
Jesin has quit [Ping timeout: 246 seconds]
Jesin has joined #lisp
iovec has joined #lisp
nanoz has joined #lisp
<mrcode_> dlowe, pjb was asking about the classic unsigned fixed width integer wraparound, where you can do 0x4 - 0xfffffffa = 0xa
<mrcode_> pjb gave the correct answer as impossible in CL
q-u-a-n2 has joined #lisp
<mrcode_> is there a good intro somewhere on the web on how to create a custom stream type that works with read-line, read-sequence, etc ? afaik those are not CLOS methods but just regular functions?
<pjb> mrcode_: read about Gray Streams.
<pjb> It's an extension that is often provided by implementations to extend streams.
<mrcode_> gotcha. thx for pointing me to that
<pjb> flexistreams is anoter example.
<mrcode_> briefly looked at flexistreams and my enthusiasm quickly dissipated ;) the link above seems more approachable
<mrcode_> thx pjb
Kundry_Wag has quit [Remote host closed the connection]
<pjb> mrcode_: notice that if you really need Z/2^n, or in general Z/p, you can easily implement it defining your own plus minus times divide operations. Or shadowing CL:+, CL:-, CL:* and CL:/, your own modular-arithemtic:+ modular-arithemtic:- modular-arithemtic:* modular-arithemtic:/ etc.
<pjb> stylewarning: ℤ = the set of integers. ℤ/p = the set of integers modulo p ; usually, processors provide various modulo p that are a power of 2, like, 2^8, 2^16, 2^32, and now 2^64.
<pjb> So, ℤ/2 = { 0̇, 1̇ }
<stylewarning> If you support Z, you support Z/n
<stylewarning> As Z/n is isomorphic to equivalence class representatives of Z
<pjb> stylewarning: not at all. (+ 1 1) #| --> 2 |# (mod (+ 1 1) 2) #| --> 0 |#
<aeth> huh? Isn't { 0, 1 } just the type bit? I mean it's probably actually a fixnum internally... except when it's stored in a bit vector or an n-d array containing bits, and potentially a typed slot in a struct
<aeth> so it's very real
<pjb> aeth: there are little dots above the digits to represent the classes!
<pjb> ℤ/3 = { 0̇, 1̇, 2̇ }
<stylewarning> pjb: You’re mistaking the notion of +.
<aeth> oh I missed that at my font size
<pjb> stylewarning: you are mistaking ℤ and ℤ/p.
<stylewarning> 2 + 3 = 5 in Z, and Z/3. It’s valid in either case.
<aeth> But all you need for that is to define your own addition
<aeth> that also does mod
<pjb> stylewarning: nope, because + in ℤ/3 is defined to return a class, not a representant.
<stylewarning> 0 = 3 = 6 = ... in Z/3 and + works perfectly fine with these elements
<stylewarning> pjb: you need to review the notion of a quotient and the notion of equivalence classes. Maybe what you’re trying to say is CL doesn’t have the equivalence relation built in as a standard function.
<pjb> stylewarning: you need an additionnal surjetion to map ℤ:+ onto ℤ/3:+
<pjb> stylewarning: I'm just saying that CL doesn't implement modular arithmetic, if you want it you have to implement it yourself.
<stylewarning> There are 3 elements in the group Z/3. The symbols 0, 3, 6, ... are all representations of the same element.
<pjb> stylewarning: CL uses an infinite number of bits to represent integers!
<stylewarning> That’s fine. Math has no business deciding representation.
<stylewarning> Z/3 algebraically doesn’t define a representation. It just is a system for describing algebraic laws
<stylewarning> You are free to fix a transversal of Z/3 with elements of Z, that’s fine, but that’s an arbitrary choice.
<aeth> stylewarning is right, technically you can just do all of the operations, and do MOD at the end to reduce to the simplified result because all of those numbers are equivalent...
<aeth> So it does support all of that by having MOD
<Bike> here i was thinking my answer to his question was fine
<stylewarning> aeth: all the MOD provides is a canonical representation. So in some sense, you don’t even need MOD.
<stylewarning> But MOD makes it easy to check if two integers fall in the same equivalence class.
<stylewarning> But making something easy doesn’t make it required.
<mrcode_> stylewarning: the point is to avoid work. you have the CPU doing this for free without thinking about it.
<stylewarning> You have it doing it for free for 2^n, yes. I understand that.
<mrcode_> right now no matter what I do, I can't get (1+ #xffffffff) => 0
<mrcode_> which would have been extremely convenient for what I am trying to do
<aeth> cl:1+, no. 1+ itself? yes.
<stylewarning> mrSpec: why do you need to mod out so fast?
<Bike> like i said, types don't influence operations. and CL sticks with integers. but you can define your own 1+ function.
<Bike> and if you declare it inline and the compiler cooperates it'll probably be nice and quick
<mrcode_> stylewarning: experimenting with some low latency networking code, figuring out what's feasible and what's not
<no-defun-allowed> iirc SBCL and CCL exploit overflowing arithmetic if you write (mod ... #.(expt 2 32)) or something like that?
<aeth> mrcode_: if you do (mod (1+ #xffffffff) (expt 2 32)) and have the proper declarations if it's a variable and not a constant, then SBCL will do the efficient result that you think it should be doing if you disassemble your function to check.
<aeth> Or for addition/subtraction in general
<aeth> multiplication is trickier, if it's even possible
<aeth> that goes for every power of 2, including potentially (expt 2 64) even though that's larger than fixnum
<stylewarning> mrcode_: Ok, so you’re not so concerned with the rings of numbers, you just care about things living in CPU registers.
<no-defun-allowed> mrcode_: see https://plaster.tymoon.eu/view/1475#1475
<aeth> well, I'm actually not sure if it's every power of 2 (haven't tested it) but it certainly works for the common ones like 2 4 8 16 32 64
<stylewarning> mrcode_: you might consider stealing my WITH-MODULAR-ARITHMETIC macro: https://github.com/stylewarning/lisp-random/blob/master/number-theoretic-transform.lisp#L208
<no-defun-allowed> the AND mask is shifted left one as that's what SBCL fixnums do, but that's basically how to get bit magic happening
<stylewarning> that works efficiently for a constant M.
<mrcode_> yes, I was just expressing my surprise that I have to go with the (logand ...) approach and I get the desired behavior on the assembler level. someone already suggested the modular arithmetic transform/optimizer in sbcl will work in some circumstances
X-Scale has joined #lisp
random-nick has quit [Ping timeout: 268 seconds]
<stylewarning> mrcode_: I’m suggesting explicit macros which hide all that funny business.
<aeth> more than some circumstances, I use it extensively and I prefer that it's explicit because having a bignum is imo a much better default for when I'm not expecting it than having it wrap
<stylewarning> There’s a bunch of other modular arithmetic goodies in there, like a fixed width multiplier that doesn’t overflow.
<stylewarning> (However things could be better using a 64-bit
<stylewarning> multiplier in x8664)
techquila has joined #lisp