<hashfunc1ebd>
the vector doesn't seem to be growing
<rotateq>
So you would use (make-array dimension :element-type 'bit :adjustable t :fill-pointer t) and maybe with :initial-contents xor :initial-element too.
<rotateq>
No for that you need VECTOR-PUSH-EXTEND.
<hashfunc1ebd>
ohh
<hashfunc1ebd>
i'll give that a go
<rotateq>
:)
<hashfunc1ebd>
that's perfect
<hashfunc1ebd>
works like a charm
<hashfunc1ebd>
rotateq: thanks
<rotateq>
And the `:fill-pointer t` sets it automatically to the specified dimension if you want to start from there.
<rotateq>
That's great. And beware, that to set bits via SETF you need BIT rather than SBIT, cause now it's really a BIT-VECTOR and not a SIMPLE-BIT-VECTOR.
<rotateq>
But you can of course use AREF too if unsure.
igemnace has quit [Quit: WeeChat 3.5]
lisp123 has joined #commonlisp
kevingal has quit [Remote host closed the connection]
pranavats has left #commonlisp [Error from remote client]
lisp123 has quit [Remote host closed the connection]
<hashfunc1ebd>
how can i formulate my type-specifier to allow it to be an extensible 'BIT-VECTOR
<rotateq>
Again I would need more information. :)
<hashfunc1ebd>
for example: (MAP '(VECTOR BIT :ADJUSTABLE T :FILL-POINTER T) ...)
<rotateq>
The type BIT-VECTOR already covers the extensible ones.
wildlander has quit [Quit: Saliendo]
<rotateq>
Ah that.
<hashfunc1ebd>
using: (MAP 'BIT-VECTOR ...) i can't use VECTOR-PUSH-EXTEND to add elements to it
<rotateq>
With the one that comes out you mean?
<hashfunc1ebd>
yes exactly
<rotateq>
You can use a LET form and in that MAP-INTO.
<hashfunc1ebd>
ah ok, i'll give that a go
<rotateq>
(let ((bv (make-array dimension :element-type 'bit :adjustable t :fill-pointer t))) (map-into bv function ...))
<rotateq>
So MAP-INTO modifies the result-sequence inplace rather than creates a new one.
<rotateq>
What I meant before was that if you would have a (check-type bv bit-vector) at some point it would pass for adjustable ones too.
<hashfunc1ebd>
rotateq: MAP-INTO works awesome. thanks for the help
semz has quit [Remote host closed the connection]
semz has joined #commonlisp
semz has quit [Remote host closed the connection]
<rotateq>
I'm happy I can be of valuable help sometimes. And excuse if some things I said turn out not to be 100% correct with all details.
semz has joined #commonlisp
zacts has joined #commonlisp
lisp123 has joined #commonlisp
thomaslewis has joined #commonlisp
thomaslewis has left #commonlisp [#commonlisp]
semz has quit [Remote host closed the connection]
didi has quit [Remote host closed the connection]
semz has joined #commonlisp
sjl has quit [Quit: WeeChat 2.2-dev]
zacts has quit [Quit: Client closed]
random-nick has quit [Ping timeout: 272 seconds]
karlosz has quit [Ping timeout: 276 seconds]
lisp123 has quit [Remote host closed the connection]
semz has quit [Quit: Leaving]
semz has joined #commonlisp
semz has quit [Remote host closed the connection]
semz has joined #commonlisp
semz has quit [Client Quit]
semz has joined #commonlisp
semz has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
<hashfunc1ebd>
rotateq: no worries at all. any pointing to the right direction is always valuable
<hashfunc1ebd>
i'm stuck on how to convert an integer to a big endian number in bits
<hashfunc1ebd>
so: number => to-big-endian => to-bits
orestarod has quit [Ping timeout: 250 seconds]
razetime has joined #commonlisp
<hashfunc1ebd>
i suppose the best approach would be to: number => to-bit-vector => transform-to-big-endian
semz has joined #commonlisp
karlosz has joined #commonlisp
semz has quit [Ping timeout: 248 seconds]
semz has joined #commonlisp
cr0myr has quit [Read error: Connection reset by peer]
semz has quit [Ping timeout: 240 seconds]
semz has joined #commonlisp
karlosz_ has joined #commonlisp
karlosz__ has joined #commonlisp
semz has quit [Ping timeout: 240 seconds]
karlosz has quit [Ping timeout: 276 seconds]
karlosz has joined #commonlisp
karlosz_ has quit [Ping timeout: 272 seconds]
lisp123 has quit [Remote host closed the connection]
karlosz__ has quit [Ping timeout: 240 seconds]
lisp123 has joined #commonlisp
karlosz has quit [Ping timeout: 276 seconds]
cr0myr has joined #commonlisp
waleee has quit [Ping timeout: 248 seconds]
Bike has joined #commonlisp
karlosz has joined #commonlisp
ebrasca` has quit [Remote host closed the connection]
lisp123 has quit [Remote host closed the connection]
akoana has quit [Quit: leaving]
CrashTestDummy has joined #commonlisp
asarch has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
CrashTestDummy has quit [Quit: Leaving]
CrashTestDummy has joined #commonlisp
CrashTestDummy has quit [Read error: Connection reset by peer]
lisp123 has joined #commonlisp
aartaka has joined #commonlisp
lisp123 has quit [Client Quit]
jmes has joined #commonlisp
cosimone has quit [Remote host closed the connection]
Oladon has quit [Quit: Leaving.]
cosimone has joined #commonlisp
semz has joined #commonlisp
igemnace has joined #commonlisp
Bike has quit [Quit: Connection closed]
asarch has quit [Quit: Leaving]
zacts has joined #commonlisp
pranavats has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
cr0myr has quit [Ping timeout: 272 seconds]
Mandus has quit [Ping timeout: 256 seconds]
Mandus has joined #commonlisp
semz has quit [Quit: Leaving]
semz has joined #commonlisp
semz has quit [Remote host closed the connection]
semz has joined #commonlisp
Mandus has quit [Ping timeout: 272 seconds]
Mandus has joined #commonlisp
karlosz has quit [Ping timeout: 276 seconds]
karlosz has joined #commonlisp
zacts has quit [Quit: Client closed]
semz has quit [Quit: Leaving]
semz has joined #commonlisp
karlosz has quit [Ping timeout: 276 seconds]
aeth has quit [Ping timeout: 272 seconds]
aeth has joined #commonlisp
ahc has joined #commonlisp
livoreno has quit [Ping timeout: 250 seconds]
Sankalp has joined #commonlisp
notzmv has quit [Ping timeout: 248 seconds]
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
zmv has joined #commonlisp
zmv has quit [Changing host]
zmv has joined #commonlisp
livoreno has joined #commonlisp
zmv is now known as notzmv
karlosz has joined #commonlisp
Inline__ has joined #commonlisp
Inline has quit [Ping timeout: 272 seconds]
<rotateq>
Hm what hashfunc said last, I should go ahead and study differences of little-endian and big-endian. And from what I see from my *FEATURES*, it contains :LITTLE-ENDIAN.
kotshie has quit [Remote host closed the connection]
karlosz has quit [Ping timeout: 276 seconds]
karlosz has joined #commonlisp
<mfiano>
One more thing:
<mfiano>
Sometimes it can be a bit intimidating to post code in a programming channel. If you feel more comfortable asking for help in private, I'd be more than happy to help. I may not immediately respond, but I will when I can. I enjoy helping so it wouldn't be a burden on me. Just try to stay connected to IRC, or use a bouncer.
<mfiano>
Ok, I'm really going back to code now.
<rotateq>
mfiano: Maybe that should have gone to #clschool?
<mfiano>
Oh jeez, yes'
<rotateq>
At least I've seen the connection. :)
treflip has joined #commonlisp
Sankalp has quit [Remote host closed the connection]
razetime has quit [Ping timeout: 276 seconds]
Sankalp has joined #commonlisp
pranavats has left #commonlisp [Error from remote client]
Nilby has quit [Ping timeout: 250 seconds]
jmdaemon has quit [Ping timeout: 260 seconds]
opcode has quit [Remote host closed the connection]
opcode has joined #commonlisp
karlosz has quit [Quit: karlosz]
razetime has joined #commonlisp
ttree has quit [Ping timeout: 250 seconds]
Sankalp has quit []
<mfiano>
Would someone mind looking at a real abomination of a function I wrote (I'm just trying to get the logic to work before I break it up and refactor it)?
<mfiano>
Applicants must not be afraid of a little tagbody/go :)
Sankalp has joined #commonlisp
X-Scale` has joined #commonlisp
<jackdaniel>
β non-local-go, %continuation-case
<mfiano>
Um?
<jackdaniel>
semirandom joke
X-Scale has quit [Ping timeout: 276 seconds]
X-Scale` is now known as X-Scale
<mfiano>
jackdaniel: This might be up your alley. text rendering
<jackdaniel>
inside joke with a circle composed of one person ;)
<jackdaniel>
im not anywhere near a computer and pkaying with the little one
<mfiano>
Well, guess I'm on my own for a late night debugging session again
cosimone has quit [Remote host closed the connection]
cosimone has joined #commonlisp
Posterdati has quit [Read error: Connection reset by peer]
X-Scale` has joined #commonlisp
X-Scale has quit [Ping timeout: 276 seconds]
X-Scale` is now known as X-Scale
<Sankalp>
Hi folks
<Sankalp>
Just learnt about Alive from the IRC topic (cl-cookbook)
<Sankalp>
Thanks so much for that
<Sankalp>
I was using slime with emacs so far
<Sankalp>
I'm more used to vscode, not that I dislike emacs or anything :D
<rotateq>
Yeah so "~{~a~^, ~}" may be what you want.
<ksp>
thanks
<ksp>
it works
ksp has quit [Quit: ERC 5.4 (IRC client for GNU Emacs 28.1)]
zeroc00l0 has quit [Quit: Client closed]
morganw has joined #commonlisp
<rotateq>
It seems in English countings like "1, 2, and 3" are with comma at the end too, in German we do "1, 2 und 3".
<beach>
It varies between countries and regions.
<rotateq>
Yes okay.
igemnace has joined #commonlisp
<Oladon>
That last comma (in English) is called an "Oxford" comma. There's a whole subculturewar about whether or not it should be used :D
<rotateq>
I've seen it the first time explicitely and realized when reading in 'The TeXbook' by Don Knuth.
<Oladon>
(Compare: "He went to a party with the strippers, Bill Gates and Steve Jobs" versus "He went to a party with the strippers, Bill Gates, and Steve Jobs")
<rotateq>
That's one of those examples, commata save lifes. :)
<Oladon>
I tend to think so!
aartaka has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Ping timeout: 272 seconds]
<jackdaniel>
is picking only strippers an option?
<rotateq>
jackdaniel: But, but, the others can tell you how to write an operating system and how to design the look of your computer.
<jackdaniel>
I have a strong conviction that most of it is marketing bullshit and brilliant engineers who were not /them/ ;)
admich has quit [Remote host closed the connection]
<rotateq>
Okay, no doubt that in the group of the other people they won't be able to do so!
<jackdaniel>
but sure, I'm jelly so
tyson2 has joined #commonlisp
azimut_ has joined #commonlisp
azimut has quit [Ping timeout: 240 seconds]
matt` has joined #commonlisp
phantomics has quit [Read error: Connection reset by peer]
kpoeck has quit [Quit: Client closed]
tane has joined #commonlisp
tane has quit [Changing host]
tane has joined #commonlisp
Bike has quit [Quit: Connection closed]
Bike has joined #commonlisp
dra has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
phantomics has joined #commonlisp
qhong has quit [Read error: Connection reset by peer]
ttree has joined #commonlisp
Oladon has quit [Quit: Leaving.]
tyson2 has joined #commonlisp
lonjil has quit [Ping timeout: 248 seconds]
lonjil has joined #commonlisp
tychoish has joined #commonlisp
waleee has joined #commonlisp
treflip has quit [Quit: good night]
livoreno has quit [Ping timeout: 240 seconds]
livoreno has joined #commonlisp
<contrapunctus>
`(loop for i to 10 when (evenp i) collect it)` => `(T T T T T T)`
<contrapunctus>
`(loop for i to 10 when (evenp i) collect (list it))` => `The variable IT is unbound.`
<contrapunctus>
:|
jmes has quit [Ping timeout: 272 seconds]
lisp123 has joined #commonlisp
Devon has joined #commonlisp
<rotateq>
contrapunctus: So in the former you have an IT defined, or not?
<contrapunctus>
I don't. It's just the inconsistency that one can refer to IT by itself, but not inside a Lisp expression...
<rotateq>
And what shall IT then be?
<contrapunctus>
rotateq: the result of `(evenp i)`
<_death>
ITERATE does it differently
lisp123 has quit [Ping timeout: 276 seconds]
<rotateq>
Yes sounds inconsistent (for MIT LOOP) and also that it accepts (loop for i to 10 ...) as valid.
blihp has joined #commonlisp
<Alfr>
rotateq, what's wrong with "for i to 10"?
<rotateq>
It's unclear. But ok, with below one can argue also this way.
<_death>
hmm, I remembered it wrong.. ITERATE indeed "does" it differently, in that it doesn't explicitly support it.. you could of course do something like (iter (for i from 1 to 10) (awhen (evenp i) (collect it)))
Noisytoot is now known as [
kpoeck has joined #commonlisp
<contrapunctus>
ah, heh
tyson2 has quit [Remote host closed the connection]
matt` has quit [Remote host closed the connection]
Oddity has joined #commonlisp
zacts has joined #commonlisp
<Nilby>
if βitβ was a bound variable instead of loop keyword, you'd have to remember to potentially guard against it in every macro involving loop, even if you never use βitβ
<blihp>
What's the best way to get blocking behavior when reading line-by-line from a file? (i.e. similar to tail -f on a logfile)
attila_lendvai has joined #commonlisp
<Nilby>
just sleep and re-read
<_death>
read-line is blocking.. you can use read-char-no-hang and unread-char if you just want to probe
aartaka has quit [Ping timeout: 272 seconds]
<blihp>
hmm... if I do read-line when at eof I get an END-OF-FILE condition when what I want it to do is wait for the next line to be written to the file
<blihp>
Nilby: the problem with polling is overhead and/or latency
<mfiano>
Why not use a stream over the file?
<Nilby>
unix tail command just does just does sleep and read
<_death>
sure, you can see the exceptional situations section in the clhs entry.. you can pass false for eof-error-p to have it return instead of signal an error.. if polling is a problem then you probably want an event-based library like, say, iolib
<Nilby>
you can just do: (loop :with line :do (if (setf line (read-line stream nil)) (write-line line *standard-output*) (sleep .2)))
<Nilby>
if you want to work on tty devices on unix which don't get eof when reading from the end you can just add a (listen stream) before reading
<Nilby>
interactive-stream-p might be able to tell you if it's a tty
<blihp>
thanks... it's just a (log) file. I guess I can play around with some sleep values and see if I can get decent balance. Mainly I was wondering if there already existed a canonical way of doing this but it sounds like I'd need to roll my own using something like iolib if needed.