bestinket has quit [Remote host closed the connection]
smokeink has joined #lisp
pfdietz has quit [Ping timeout: 260 seconds]
akoana has joined #lisp
tumdum has quit [Ping timeout: 268 seconds]
tumdum has joined #lisp
Kundry_Wag has joined #lisp
learning has joined #lisp
sjl has joined #lisp
learning has quit [Remote host closed the connection]
Seteeri has quit [Ping timeout: 240 seconds]
learning has joined #lisp
clothespin__ has quit [Ping timeout: 260 seconds]
learning has quit [Remote host closed the connection]
learning has joined #lisp
clothespin has joined #lisp
shifty has joined #lisp
learning has quit [Remote host closed the connection]
learning has joined #lisp
prumnopytis has quit [Remote host closed the connection]
saravia has quit [Ping timeout: 265 seconds]
Sauvin has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
trocado has quit [Read error: Connection reset by peer]
Kundry_Wag has quit [Remote host closed the connection]
<bitmapper>
no-defun-allowed: summoning the portal is not working
<bitmapper>
:p
<no-defun-allowed>
bitmapper: If you're here in #lisp on IRC to complain about a meme I linked on Twitter on jstpst that's written in ML, you probably should do that somewhere else.
<bitmapper>
nah, i write lisp
<bitmapper>
i've been here for a while
<no-defun-allowed>
Still, not even a Lisp joke, so I wouldn't mention it here.
Kundry_Wag has joined #lisp
madage has quit [Remote host closed the connection]
bitmapper has quit [Ping timeout: 258 seconds]
brettgilio_ has joined #lisp
brettgilio has quit [Ping timeout: 260 seconds]
gigetoo has quit [Ping timeout: 250 seconds]
gigetoo has joined #lisp
Sauvin has quit [Read error: Connection reset by peer]
Sauvin has joined #lisp
Kundry_Wag has quit [Remote host closed the connection]
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Ping timeout: 258 seconds]
ahungry has joined #lisp
saravia has joined #lisp
terpri has joined #lisp
freedom has quit [Remote host closed the connection]
freedom has joined #lisp
Lord_of_Life has quit [Ping timeout: 260 seconds]
learning has quit [Ping timeout: 268 seconds]
Lord_of_Life has joined #lisp
Kundry_Wag has joined #lisp
Kundry_Wag has quit [Client Quit]
dddddd has quit [Remote host closed the connection]
vidak` has joined #lisp
froggey has quit [Ping timeout: 260 seconds]
froggey has joined #lisp
quazimodo has quit [Ping timeout: 260 seconds]
quazimodo has joined #lisp
madage has joined #lisp
freedom has quit [Remote host closed the connection]
saravia has quit [Quit: Leaving]
EvW1 has quit [Ping timeout: 245 seconds]
fyrkrans has quit [Remote host closed the connection]
<_death>
smokeink: series are lazy, so read-line gets called when the result is printed, after w-i-f-s is exited
v88m has quit [Ping timeout: 268 seconds]
<_death>
smokeink: otherwise the code is still bogus, using the (complement of the) lambda as a predicate for until-if, and otherwise discarding the result of read-line
<smokeink>
1sec I'll put a working version
<[df]>
ebrasca: apologies for not responding to your assistance before, I'd wandered away from the computer - I got it working in the end and it turned out to be a stupid embarrassing mistake, the .el in question wasn't actually being loaded anywhere else in the config
ebrasca has quit [Remote host closed the connection]
Necktwi_ has quit [Quit: leaving]
<_death>
smokeink: (collect (subseries (scan-stream s #'read-line) 0 2))
<smokeink>
cool
<smokeink>
can scanning-until-eof also be expressed shorter than in my last paste?
<_death>
scan-stream does this automatically.. (collect (scan-stream s #'read-line)) will read until eof
Duuqnd has joined #lisp
<smokeink>
nice
<smokeink>
(iterate ((line (scan-stream s #'read-line))) (princ line) (terpri))
<smokeink>
"(If you know CLOJURE, you will be reminded of its lazy sequences; something SERIES apparently already had in the 1980s.)" - Edi Weitz , Common Lisp Recipes
<smokeink>
So does Clojure has anything important which is missing in Common Lisp? I don't get it yet why so many people learn Clojure instead of CL
<jackdaniel>
it has clear directions how you should do things
<_death>
it has buzz
<jackdaniel>
something CL clearly lacks (advantage and disadvantage at the same time)
shifty has quit [Ping timeout: 268 seconds]
cosimone has joined #lisp
<galdor>
lots of concurrency goodies
<galdor>
the type spec stuff is also interesting
<galdor>
immutability
je4i has quit [Ping timeout: 264 seconds]
slyrus_ has joined #lisp
<jackdaniel>
you forgot about immortality and a good luck for 4 rounds ;)
nicola_pav_ has joined #lisp
Necktwi has joined #lisp
slyrus has quit [Ping timeout: 265 seconds]
isBEKaml has joined #lisp
nicola_pav has quit [Ping timeout: 260 seconds]
isBEKaml has quit [Client Quit]
je4i has joined #lisp
clothespin_ has quit [Ping timeout: 265 seconds]
Necktwi_ has joined #lisp
Necktwi has quit [Ping timeout: 265 seconds]
je4i has quit [Ping timeout: 264 seconds]
orivej has quit [Ping timeout: 265 seconds]
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
cosimone has quit [Client Quit]
<smokeink>
lol
jonatack has quit [Ping timeout: 258 seconds]
clothespin has joined #lisp
orivej has joined #lisp
je4i has joined #lisp
je4i has quit [Remote host closed the connection]
mathrick has joined #lisp
Inline has quit [Quit: Leaving]
__jrjsmrtn__ has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
Inline has joined #lisp
_jrjsmrtn has quit [Ping timeout: 240 seconds]
Lycurgus has joined #lisp
brettgilio_ has quit [Quit: Quit]
brettgilio has joined #lisp
gxt has joined #lisp
varjag has joined #lisp
narimiran has quit [Quit: leaving]
Lycurgus has quit [Quit: Exeunt]
je4i has joined #lisp
FreeBirdLjj has joined #lisp
Kevslinger has joined #lisp
smokeink has quit [Ping timeout: 260 seconds]
nicola_pav_ has quit [Quit: Leaving]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
longshi has joined #lisp
narimiran has joined #lisp
oni-on-ion has joined #lisp
cosimone has joined #lisp
orivej has joined #lisp
mingus has joined #lisp
mingus has quit [Remote host closed the connection]
gxt has quit [Ping timeout: 240 seconds]
cosimone_ has joined #lisp
cosimone has quit [Ping timeout: 248 seconds]
wxie has joined #lisp
Bike has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
EvW1 has joined #lisp
pfdietz has joined #lisp
black_13 has joined #lisp
<black_13>
i am interested in the possible internals of a lisp implementation specifically an s-expression
<beach>
Sounds good.
<beach>
What do you need to know?
clothespin has quit [Ping timeout: 258 seconds]
<pjb>
Not much it seems…
<beach>
Patience pjb.
ArthurStrong has joined #lisp
LiamH has joined #lisp
<black_13>
beach was that response for me
<beach>
Yes.
<beach>
Go ahead and ask.
<black_13>
what would (a (b c) e f) look like or could look like if implemented in c
<beach>
A sequence of 4 CONS cells.
<beach>
The CAR of the first CONS cell would be a pointer to the symbol A.
<beach>
The CDR of the first CONS cell would be a pointer to the second CONS cell.
<black_13>
and that makes sense
<pfdietz>
Are you asking about cons cells? They are typically two words (64 bits on a 64 bit machine), aligned on addresses that are zero modulo 16. They are allocated on a heap without any extra space around them.
<pfdietz>
(in some implementations)
<beach>
black_13: The CAR of the second CONS cell would be a pointer to a sequence of 2 CONS cells.
<black_13>
let me write down something
<beach>
Sure.
<black_13>
sorry i should have been better prepared
<beach>
black_13: But there is no reason to assume that a Common Lisp implementation would be written in C.
<beach>
Some are, but definitely not all.
<Xach>
great, someone broke PROVE and that broke a zillion test systems.
<pfdietz>
Oh dear.
<black_13>
beach I am interested in something like lisp but not lisp
<black_13>
or not-yet
<beach>
black_13: Well, this channel is dedicated to Common Lisp, so that's the information you will get.
<black_13>
is there a channel where what i am ask about would be topical
v88m has joined #lisp
<beach>
There is ##lisp, but I don't participate there.
<Bike>
##lisp, maybe? "lisp but not" is kind of vague
<pjb>
black_13: even when programming in C, you would use functional abstraction, so you'd build a sexp like (a (b c) e f) with C calls such as: cons(intern("A"),cons(cons(intern("B"),cons(intern("C"),intern("NIL"))),cons(intern("E"),cons(intern("F"),intern("NIL")))))
<pjb>
black_13: how cons and intern are implemented are irrelevant.
cosimone_ has quit [Remote host closed the connection]
<pfdietz>
black_13: getting Common Lisp to run at top efficiency requires diving below what C provides. There are tricks that are exploited at the machine level. There are Common Lisps that transpile to C before using a C compiler to go down to machine code, but they are typically slower.
cosimone_ has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
<black_13>
pfdietz i wish I had the brains to be at that place you just described
<pfdietz>
There's also a CL implemented in C that compiles to byte code, but it is very much slower (Clisp).
<pfdietz>
And a CL that compiles to JVM byte codes (Armed Bear Common Lisp), but it pays a price for the mismatch between JVM and what would be the best byte code for CL.
<pfdietz>
Xach: it's ok, lots of systems on QL don't even have test suites. :)
<Xach>
Hmm, it looks like PROVE used an internal symbol of CL-ANSI-TEXT, and it was removed/renamed.
<nicola_pav>
hi. I am getting the following error when I try to run the function byte-vector-to-bytea
<black_13>
the cell struct would ask as cell pointers and cotainer of ideas
<nicola_pav>
Could not read input: byte-vector-to-bytea called on a string
<nicola_pav>
my input is a csv file
<black_13>
i mean the cell struct would act as cell pointers and cell contents
<black_13>
the following is a legitimate of s-expression "()"
<pfdietz>
That system with poor test coverage I wanted to play with over the weekend? I wrote tests to cover two files (mostly) and found 9 distinct bugs. Mothers, don't let your children grow up to write code without tests.
<pjb>
black_13: usually, cons cells are kept of fixed size to ease memory management. Therefore data that is bigger than a pointer is not stored in the cons cell itself, but on the heap, and pointed to by the cons cells.
<beach>
black_13: In real life, you wouldn't do it that way, because you would have so many things in your union, like symbols, hash tables, arrays, complex numbers, streams, etc.
<black_13>
baby steps bob baby steps
<black_13>
i have looked at simple lisp implementations and even the simple ones use hashtables for look up and ask you said arrays and so on
<black_13>
lets just say strings
<Xach>
nicola_pav: it sounds like it is meant to work on byte vectors, not strings. what are you trying to do?
<black_13>
i get free time and when i get free time i think about lisp internals
<pfdietz>
The pointer nature of cons cell contents is also required to properly implement object identity in lisp. A cons cell points to a preexisting object, and other references to that object remain valid.
brown121407 has quit [Ping timeout: 258 seconds]
<nicola_pav>
Xach: I am using pgloader to load data from csv into postgres. one field is hex and needs to get into a bytea field in postgres
<pfdietz>
The only except are numbers and characters, which are not guaranteed to retain object identity (the code can copy them at any time).
<beach>
black_13: You can certainly do it that way, if that's what you are asking.
brown121408 has joined #lisp
<black_13>
i have been trying to "cheat" and look at others implementations
<nicola_pav>
Xach: when not manipulating the fields, the data in the bytea field is converted to a non-hex which is wrong
<black_13>
lots of them and they seem to have done what i am doing ... they found something worked on then moved on ...
<Xach>
nicola_pav: the field is a hex string?
<nicola_pav>
Xach: yes
<Xach>
nicola_pav: i don't know a lot about pgloader but i do know how to convert a hex string to a byte vector
<nicola_pav>
Xach: that could help
brown121408 has quit [Read error: Connection reset by peer]
<beach>
black_13: It is hard for me to tell what you really want. I can tell you that your idea will work, but if you really want to know how it is done, I can't very well tell you that your idea is a good one.
brown121408 has joined #lisp
<Shinmera>
Xach: Prove has been superseded by another thing by the author, but evidently most people did not care to change their libraries for the new thing (or something else).
<black_13>
beach yeah
<Xach>
nicola_pav: well, if i were you, i would write a dummy routine named hex-to-bytea that just returns a byte vector and see if you can plug it into the pgloader pipeline
<beach>
black_13: Yeah what? Which one is it?
<Xach>
nicola_pav: if that works, then i would make hex-to-bytea do real work.
<black_13>
and this place is not set up for socratic method
<black_13>
and read and then come here for clarification
<black_13>
and ... my coworkers are COMPLETELY uninterested in lisp/scheme ... "its old to many parenthesis"
<beach>
black_13: You can look at chapter 15 of metamodular.com/SICL/sicl-specification.pdf for a detailed description of how SICL represents its objects.
<black_13>
oh thats a new one
<black_13>
its like anything i have some side time i read as much as can then i have to get back to the day job
<beach>
black_13: Well, it is called "-specification" because the system does not exist yet.
<black_13>
oh
<black_13>
do you have a link
<beach>
To the code? Sure, but I don't recommend you try to run the code.
<beach>
minion: Please tell black_13 about SICL.
<minion>
black_13: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL
brown121408 has quit [Ping timeout: 268 seconds]
cosimone_ has quit [Quit: Terminated!]
<Xach>
Shinmera: I wonder what will happen.
brown121408 has joined #lisp
<pjb>
yeah, sicl should have been named fatricl.
<pjb>
or perhaps fatriclfs
oni-on-ion has quit [Ping timeout: 248 seconds]
<pjb>
It's not too late, until the first usable version, to change the name…
<beach>
black_13: It is hard to express the layout of Common Lisp objects in C, because C is a statically typed language, and Common Lisp is not. Furthermore, we typically use tricks like tagged pointers for efficient immediate objects, also hard to express in C.
Lord_of_Life has quit [Ping timeout: 260 seconds]
Lord_of_Life_ is now known as Lord_of_Life
<beach>
black_13: You have to bend C quite a bit to make it express things like Common Lisp objects.
<black_13>
have you seen that bending some place
<black_13>
other than the common lisp code
<Bike>
rivest's s expressions are for data transport over the wire rather than code per se, and also this is from 1997, so yes it's kind of weird
<Bike>
i think this conversation may be more suited for elsewhere
<p_l>
I seem to recall some people here mentioning writing a half-assed lisp when forced to use a different language
<black_13>
whats the harm in talking
<beach>
black_13: This channel is pretty strict about sticking to the topic.
<black_13>
ok do you have a channel that might discuss this
<Bike>
try ##lisp, like we said earlier
<beach>
black_13: If you are truly interested in how Common Lisp objects might be represented in a very simple and regular way, we can take the discussion to #sicl, but I am not interested in trying to express such representations in C.
<black_13>
you dont spend time there
<black_13>
join #sicl
<pjb>
black_13: the point is that if you want to write standard C code to implement C, you will obtain a program that is quite less efficient than if you write assembler. CL implementations that target native code (ie. assembler), instead of C, are way more efficient.
<pjb>
black_13: or, you can use C in a non-standard, undefined and non-portable way.
<black_13>
s-expr are a good idea
<black_13>
i worked on a program that essentiall had lists of things
<black_13>
But done badly
<Bike>
i don't spend time in ##lisp because i'm not usually too interested in this kind of conversation, which is true of other people as well, which is why we try to stay on topic.
<LdBeth>
black_13: maybe Kyoto Common Lisp family suits you. One is ECL and another is GCL.
<pfdietz>
ECL is more alive these days.
<black_13>
i had tripped over that one
<LdBeth>
But you can find more materials for reference if you search Kyoto Common Lisp
<black_13>
LdBeth thanks
Lycurgus has joined #lisp
Lycurgus has quit [Client Quit]
pnp has joined #lisp
wsinatra has joined #lisp
<pjb>
black_13: what is your interest? Do you want to write this program in Common Lisp, or do you want to write it in C? If in CL, why do you care how it's implemented? If in C, you could use libecl, or some other library. In anycase, if in C, the main point would be to use a garbage collector such as BoehmGC.
<pjb>
black_13: if in C, you don't care how it's implemented in C, you just need a good C library.
<jackdaniel>
pjb: not necessarily way more efficient, that depends on the code produced by the implementation and the c compiler
<pjb>
(for dynamic programming).
<pjb>
jackdaniel: sure, you can just ignore all efficiency discussion.
<pjb>
jackdaniel: but for example, for typetags, there's no provision in standard C to store typetags in pointers. So you would have to have a struct…
<jackdaniel>
i.e unboxed arithmetic operations may be faster (of course it boils down then to comparison between C compiler and CL->assembler compiler)
<pfdietz>
black_13: one example of something that happens in fast lisp implementations: pointers to cons cells are shifted slightly (by 3 bytes, say), and the car/cdr operations use ptr+offset addressing modes to compensate. Done properly, this means attemtps to reference non-cons pointers this way causes a fault. No extra code is needed to check that the
<pfdietz>
pointer is good.
khisanth_ has quit [Ping timeout: 260 seconds]
<pjb>
pfdietz: note that you cannot express this in standard C.
<pfdietz>
Right
<pjb>
basically, you can go pointer -> intptr_t -> pointer, but int -> pointer is undefined/implementation dependant.
<jackdaniel>
but it is often done in practice, and C is basically driven by undefined behavior
xvx has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
<pfdietz>
If you engage in undefined behavior, C compilers are allowed to take revenge on you.
v88m has quit [Ping timeout: 258 seconds]
<pfdietz>
"Ah, this is undefined. I can do anything, including declaring this code (and anything necessarily leading to it) is dead."
<jackdaniel>
Star Wars XVIII: revenge of the C
Necktwi_ is now known as Necktwi
<pfdietz>
Undefined/implementation defined behavior makes differential compiler testing hard. Props to the Utah people who addressed this in Csmith. It's much less of a problem in Common Lisp.
khisanth_ has joined #lisp
_dx has joined #lisp
<_dx>
greetings from Mezzano
<beach>
Hello _dx.
<pjb>
_dx: congrats!
sjl has quit [Quit: WeeChat 2.2-dev]
<ggole>
A surprising amount of languages have undefined behaviour
Jachy has quit [Quit: User has been idle for 30+ days.]
<beach>
ggole: "number". "number" of things. "amount" of stuff.
_dx has quit [Remote host closed the connection]
<pfdietz>
Gratuitous undefined behavior. Why does the evaluation order of arguments to a function call have to be implementation dependent?
<ggole>
Yeah, I wrote "there's a surprising amount of UB" and then edited it rather badly. :)
<beach>
Heh!
<ggole>
It's even more annoying since the workarounds that you would usually employ to avoid different behaviour might mask the bugs you are looking for
monokrom has joined #lisp
lucasb has joined #lisp
<beach>
Common Lisp has way too much undefined behavior than I would have liked.
<pjb>
Indeed.
akanouras has left #lisp ["Kicked by @appservice-irc:matrix.org : User has been idle for 30+ days."]
<pfdietz>
beach: I agree. But at least integers are closer to living up to that name, and arguments are evaluated left to right.
<beach>
There is that, sure.
sam217pa has quit [Ping timeout: 248 seconds]
learning has joined #lisp
nicola_pav has quit [Quit: Leaving]
william1 has joined #lisp
william1 has quit [Client Quit]
cosimone has joined #lisp
<oni-on-ion>
beach, yeah. good thing we dont have to compare it with anything more mainstream, with undefined behavior that is depended on
xvx has quit [Ping timeout: 240 seconds]
<Bike>
how often does arguments being evaluated left to right actually come up?
<Bike>
one time i tried something in clasp that broke that for one thing, but it only mattered to some code xerox loop generated... of course, without loop i couldn't try a lot of other systems or anything
<Shinmera>
passing i++ etc in C is not uncommon
<beach>
oni-on-ion: I think we are saved by our culture. We don't have a history of exploiting undefined behavior for extreme performance purposes the way C compiler writers do.
<Bike>
in lisp, i meant
<Bike>
c/c++ evaluation order gets kind of weird, for sure
v88m has joined #lisp
<Shinmera>
Bike: I'm just saying people do it even when there's actual danger :)
<Bike>
but i don't know, i don't see people writing (foo (incf i) (incf i)) much, i guess
<oni-on-ion>
beach, that is true. reading wiki.c2.com the other day shone a nice light on the situation. (especially when also compared to the community of what i am otherwise accustomed)
<Shinmera>
Bike: I assume the most common cause would be in functions that are implicitly side-effecting. Eg you call some other thing for a value that happens to side-effect.
mearth has joined #lisp
<Bike>
mm. probably.
<Bike>
i do write that on occasion, but it's not like using a let instead to force an order would be too burdensome
<Bike>
usually with a values call, i think...
<Shinmera>
Bike: In any case I'm not convinced that the gains in performance from argument reordering are worth the cost of mental overhead of having to think about the possibility of reordering.
<Shinmera>
In fact I'm not convinced that there's much gain at all from reordering.
<pfdietz>
I am sure it's not worth it.
<mearth>
Is asdf still the best way to organize a small sbcl project in 2019?
<pfdietz>
It might have made some sort of sense when C compilers were running in 64K address spaces on PDP-11s.
shaakyamuni[m] has left #lisp ["Kicked by @appservice-irc:matrix.org : User has been idle for 30+ days."]
<pfdietz>
But now? It would mean the compiler could not optimize code that had been arranged to be without the nondeterminism. Not a very good compiler, in that case.
<beach>
mearth: Yes.
<mearth>
beach: thanks
<oni-on-ion>
mearth, there is quickproject.
v88m has quit [Ping timeout: 258 seconds]
<Bike>
mm, probably not. i wonder about some magical system where doing it in parallel could make sense, but that's probably way too fine grained
cosimone_ has joined #lisp
cosimone has quit [Ping timeout: 248 seconds]
EvW1 has quit [Ping timeout: 260 seconds]
bitmapper has joined #lisp
payphone` has quit [Read error: Connection reset by peer]
<pfdietz>
Which is the recommended protobuf system for CL: protobuf, or cl-protobufs?
jonatack has joined #lisp
black_13 has quit [Remote host closed the connection]
<eeeeeta>
pfdietz: I managed to get https://github.com/brown/protobuf working after some playing around with it for my osmpbf library
longshi has quit [Ping timeout: 248 seconds]
<eeeeeta>
although I didn't bother with the asdf integration; I just compiled the protoc plugin and used the generated code
MichaelRaskin has joined #lisp
longshi has joined #lisp
xvx has joined #lisp
longshi has quit [Ping timeout: 252 seconds]
efm has quit [Ping timeout: 260 seconds]
jonatack has quit [Quit: jonatack]
jonatack has joined #lisp
loke has joined #lisp
je4i has quit [Ping timeout: 264 seconds]
je4i has joined #lisp
gxt has joined #lisp
gxt has quit [Ping timeout: 240 seconds]
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #lisp
orivej has quit [Ping timeout: 258 seconds]
brown121408 has quit [Read error: Connection reset by peer]
gxt has joined #lisp
brown121408 has joined #lisp
brown121408 has quit [Ping timeout: 260 seconds]
gxt has quit [Ping timeout: 240 seconds]
jeosol has quit [Ping timeout: 260 seconds]
mearth has quit [Read error: Connection reset by peer]
mearth has joined #lisp
sam217pa has joined #lisp
sam217pa has left #lisp [#lisp]
mearth has quit [Ping timeout: 248 seconds]
slyrus__ has joined #lisp
loke has quit [Remote host closed the connection]
slyrus_ has quit [Ping timeout: 268 seconds]
slyrus_ has joined #lisp
slyrus__ has quit [Ping timeout: 265 seconds]
shinohai has quit [Quit: huehuebrbr]
mearth has joined #lisp
shinohai has joined #lisp
sjl has joined #lisp
mearth has quit [Ping timeout: 260 seconds]
v88m has joined #lisp
je4i has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
ggole has quit [Quit: Leaving]
pnp has quit [Remote host closed the connection]
clothespin has joined #lisp
shangul has quit [Ping timeout: 240 seconds]
v88m has quit [Ping timeout: 258 seconds]
clothespin has quit [Ping timeout: 260 seconds]
shka_ has quit [Quit: Konversation terminated!]
torbo has joined #lisp
shka_ has joined #lisp
mearth has joined #lisp
je4i has joined #lisp
je4i has quit [Client Quit]
je4i has joined #lisp
clothespin has joined #lisp
mearth has quit [Ping timeout: 248 seconds]
jmercouris has joined #lisp
orivej has joined #lisp
brettgilio has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 240 seconds]
learning has quit []
clothespin has quit [Ping timeout: 240 seconds]
Sauvin has quit [Ping timeout: 258 seconds]
<markasoftware>
Is there any way to read a string from a stream until a certain character or set of characters, rather than (read-line)? Mainly, I want to always read until \r\n (CRLF), not some implementation-defined newline which may just be \n on unix
<markasoftware>
and if there is not such a function, is the best performance to implement it myself to make a string and append to it inside of a (read-char) loop?
jmercouris has quit [Remote host closed the connection]
mearth has joined #lisp
<galdor>
you can write your own stream with an internal buffer
<galdor>
with trivial-gray-streams it's not incredibly hard
mearth has quit [Ping timeout: 260 seconds]
caoliver has joined #lisp
<caoliver>
2.0!
<pjb>
[-0p[ol;./
<pjb>
-p=[];'
<pjb>
oops.
<caoliver>
Wonder if it will mandate reinstalling slime.
* caoliver
knows it will need rebuilding maxima.
<pjb>
markasoftware: CR and LF are codes, not characters. So to read them, you need to read a binary stream.
fookara has quit [Remote host closed the connection]
ssd532` has quit [Ping timeout: 265 seconds]
<caoliver>
Slime and Maxima still work. Upgrade done.
vlatkoB has quit [Remote host closed the connection]
cosimone_ has quit [Quit: Quit.]
metallicus has joined #lisp
longshi has joined #lisp
<markasoftware>
pjb: Are streams and binary streams the same, you just have to only use *-byte functions for binary ones?
<markasoftware>
I guess I should say, the only difference between binary and non-binary streams are their contents?
<_death>
markasoftware: flexi-streams provide an :eol-style parameter
efm has joined #lisp
<markasoftware>
flexi-streams provides functions for dealing with binary streams, but I don't need to actually create new "binary streams", right? I can still use *standard-output*, etc?
<_death>
markasoftware: you need to wrap it in a flexi-stream
mearth has joined #lisp
orivej has joined #lisp
mearth has quit [Ping timeout: 260 seconds]
<markasoftware>
thanks!
<_death>
the clhs page for *standard-output* and friends doesn't state that they are character streams, but maybe it's stated elsewhere.. that read-char etc. have these as defaults is a strong indicator.. but they could in theory be bivalent streams
<markasoftware>
I'm actually using a usocket stream, which is certainly binary
cosimone has joined #lisp
Dibejzer has joined #lisp
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
orivej has quit [Ping timeout: 265 seconds]
narimiran has quit [Ping timeout: 240 seconds]
efm has quit [Quit: Konversation terminated!]
smokeink has joined #lisp
sjl has quit [Quit: WeeChat 2.2-dev]
oldtopman has quit [Ping timeout: 240 seconds]
gareppa has joined #lisp
orivej has joined #lisp
cosimone has quit [Quit: Quit.]
cosimone has joined #lisp
Dibejzer has quit [Read error: Connection reset by peer]
mearth has joined #lisp
mearth has quit [Client Quit]
okflo has joined #lisp
hapticFeels has quit [Remote host closed the connection]
X-Scale has quit [Ping timeout: 265 seconds]
gravicappa has quit [Ping timeout: 268 seconds]
Duuqnd has quit []
okflo has left #lisp [#lisp]
cosimone has quit [Quit: Quit.]
metallicus has quit [Quit: Leaving]
krisfris_ has joined #lisp
gareppa has quit [Quit: Leaving]
orivej has quit [Ping timeout: 265 seconds]
nowhere_man has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
vaporatorius has joined #lisp
pfdietz has left #lisp [#lisp]
slyrus_ has quit [Quit: Leaving]
fengshaun has quit [Quit: bibi!]
smokeink has quit [Ping timeout: 260 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
fengshaun has joined #lisp
q-u-a-n2 has quit [Read error: Connection reset by peer]
shifty has joined #lisp
q-u-a-n2 has joined #lisp
gravicappa has joined #lisp
freedom has joined #lisp
dilated_dinosaur has quit [Quit: Leaving]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
je4i has quit [Quit: ERC (IRC client for Emacs 25.3.1)]
shka_ has quit [Remote host closed the connection]
dilated_dinosaur has joined #lisp
koenig has quit [Quit: WeeChat 2.5]
akoana_ has joined #lisp
akoana_ has quit [Client Quit]
akoana has joined #lisp
stepnem_ has joined #lisp
gravicappa has quit [Ping timeout: 265 seconds]
stepnem has quit [Ping timeout: 260 seconds]
shka_ has joined #lisp
<galdor>
regarding package local nicknames, is there a way to use them when playing around in the REPL ? it's nice when you are in a package which happens to use another package with a local nickname
<galdor>
but if you are in :CL-USER, it does not help much, you end up having to type the long package names
<LdBeth>
Usually I just switch to a new package other than CL-USER then use-package what I need to play with
<selfsymmetric-mu>
I have a number of bindings to condition-action pairs. I want to dump them into one big cond. The form above works fine but I feel like `eval` is unnecessary. Any advice?
<no-defun-allowed>
You probably cannot if you're working with that kind of data.
<selfsymmetric-mu>
Oh, no kidding? Hmm.
<no-defun-allowed>
However, if you changed each pair to a pair of two functions, you could call the first, then call the second if the first returns true.
fengshaun has quit [Remote host closed the connection]
gxt has joined #lisp
<selfsymmetric-mu>
And then how would I call it?
<selfsymmetric-mu>
I could construct `(cond ((car *action1*) (cdr *action1*)))` but then I'd still need to eval it.
<selfsymmetric-mu>
A more general question would be, what is the correct way to call some code you've constructed through quasiquotation.
<no-defun-allowed>
Then, assuming you had a list of those, I would do something like (loop for (test . result) in alist when (funcall test) return (funcall result))
<no-defun-allowed>
Perhaps I don't get the context, but I would avoid generating and storing code like that usually.
<selfsymmetric-mu>
What would be your style? Just keep them all inline as a big `cond` block?
<selfsymmetric-mu>
I kind of like the idea of a predicate-action pair.
<selfsymmetric-mu>
And the reason I'm using `cond` is because I want it to terminate on the first success.
<no-defun-allowed>
I would use functions like those.
<_death>
if you just want the forms to be defined separately, you can use generic functions.. they are kind of an extensible cond
fengshaun has joined #lisp
<no-defun-allowed>
Then that LOOP form I provided does terminate on the first success (note the RETURN symbol).
<selfsymmetric-mu>
Aha! Yes I misread, thank you no-defun-allowed.
random-nick has quit [Ping timeout: 268 seconds]
<selfsymmetric-mu>
If I were to instead rewrite these actions as `(defun action1 () (if predicate-p (do-something)))`, and I have a list of bindings of that form, how can I get them to short-circuit?
wxie has quit [Ping timeout: 265 seconds]
<selfsymmetric-mu>
funcall is less eval, yes?
<_death>
if they return non-nil in case they do something, (some #'funcall actions)