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)
<|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_>
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>
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