orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
nicktick has joined #lisp
delial has joined #lisp
oxum has joined #lisp
mikecheck has joined #lisp
rumbler31 has joined #lisp
Lycurgus has joined #lisp
rumbler31 has quit [Ping timeout: 246 seconds]
jprajzne has quit [Ping timeout: 256 seconds]
emys has joined #lisp
jprajzne has joined #lisp
bitmapper has quit [Ping timeout: 240 seconds]
wxie has quit [Quit: wxie]
wxie has joined #lisp
emys has quit [Ping timeout: 246 seconds]
orivej has quit [Ping timeout: 256 seconds]
milanj has quit [Quit: This computer has gone to sleep]
emys has joined #lisp
emys has quit [Ping timeout: 244 seconds]
fluxwave has joined #lisp
fluxwave has quit [Client Quit]
fluxwave has joined #lisp
emys has joined #lisp
oxum has quit [Ping timeout: 256 seconds]
cosimone has quit [Quit: Quit.]
toorevitimirp has quit [Ping timeout: 258 seconds]
ArthurStrong has quit [Ping timeout: 272 seconds]
Necktwi has quit [Ping timeout: 246 seconds]
emys has quit [Read error: Connection timed out]
Lycurgus has quit [Remote host closed the connection]
Necktwi has joined #lisp
emys has joined #lisp
zaquest has quit [Quit: Leaving]
zaquest has joined #lisp
emys has quit [Ping timeout: 258 seconds]
emys has joined #lisp
ArthurStrong has joined #lisp
emys has quit [Ping timeout: 260 seconds]
shangul has joined #lisp
emys has joined #lisp
ArthurStrong has quit [Ping timeout: 258 seconds]
ArthurStrong has joined #lisp
wxie has quit [Ping timeout: 246 seconds]
wxie has joined #lisp
emys has quit [Ping timeout: 260 seconds]
Bike has quit [Quit: leaving]
jesse1010 has quit [Ping timeout: 256 seconds]
emys has joined #lisp
ArthurStrong has quit [Ping timeout: 265 seconds]
jprajzne has quit [Quit: jprajzne]
ArthurStrong has joined #lisp
gaqwas has quit [Ping timeout: 256 seconds]
gaqwas has joined #lisp
oxum has joined #lisp
jprajzne has joined #lisp
Jeanne-Kamikaze has quit [Quit: Leaving]
<beach>
<beach>
Good morning everyone!
jprajzne has quit [Quit: jprajzne]
emys has quit [Ping timeout: 258 seconds]
dawgmatix has joined #lisp
emys has joined #lisp
jprajzne has joined #lisp
<ArthurStrong>
beach: indeed
<ArthurStrong>
beach: I can't resist replying you
<ArthurStrong>
sorry
<beach>
It's fine.
emys has quit [Ping timeout: 260 seconds]
emys has joined #lisp
mikecheck has quit [Remote host closed the connection]
eta has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
emys has quit [Ping timeout: 260 seconds]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
emys has joined #lisp
Bit_MCP has joined #lisp
Aurora_v_kosmose has quit [Quit: brb]
emys has quit [Ping timeout: 260 seconds]
ArthurStrong has quit [Ping timeout: 258 seconds]
Aurora_v_kosmose has joined #lisp
emys has joined #lisp
emys has quit [Ping timeout: 256 seconds]
emys has joined #lisp
jfrancis_ has joined #lisp
Bit_MCP has quit [Quit: Leaving]
jfrancis has quit [Ping timeout: 260 seconds]
madnificent has quit [Remote host closed the connection]
theseb has quit [Quit: Leaving]
slyrus has joined #lisp
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
emys has quit [Ping timeout: 260 seconds]
Codaraxis has quit [Remote host closed the connection]
Codaraxis has joined #lisp
Codaraxis has quit [Remote host closed the connection]
shifty has joined #lisp
Codaraxis has joined #lisp
jprajzne has quit [Client Quit]
emys has joined #lisp
jprajzne has joined #lisp
ech has quit [Ping timeout: 260 seconds]
sdumi has quit [Ping timeout: 264 seconds]
emys has quit [Ping timeout: 258 seconds]
sdumi has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
emys has joined #lisp
<emacsomancer>
using osicat-posix:stat - for atime, mtime, ctime - what format does it return in? it doesn't look like universal time
wxie has joined #lisp
emys has quit [Ping timeout: 256 seconds]
emys has joined #lisp
<pjb>
emacsomancer: it's a unix epoch-based time.
<pjb>
man 2 stat
<emacsomancer>
pjb: shouldn't it be the same time format as (get-universal-time) returns?
<pjb>
No.
<emacsomancer>
ah
<pjb>
or even, struct stat.st_atimespec is a struct timespec.
_Ark_ has joined #lisp
<emacsomancer>
so I probably want cl-epoch or something to convert
<pjb>
or not convert. Depends on what you want to do.
<emacsomancer>
right - or just grab current epoch time or whatever
Blukunfando has quit []
beach` has joined #lisp
beach has quit [Ping timeout: 272 seconds]
beach` is now known as beach
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
sdumi has quit [Ping timeout: 258 seconds]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
wxie has quit [Ping timeout: 258 seconds]
ramenbytes has joined #lisp
ramenbytes has left #lisp [#lisp]
<easye>
clear
<easye>
excuse me. Good morning, Europe.
<beach>
Hello easye.
ramenbytes has joined #lisp
ramenbytes has quit [Remote host closed the connection]
<no-defun-allowed>
Good morning easye
jprajzne has quit [Quit: jprajzne]
jprajzne has joined #lisp
* easye
waves to all.
ramenbytes has joined #lisp
ebrasca has quit [Remote host closed the connection]
jprajzne has quit [Client Quit]
jprajzne has joined #lisp
dddddd has quit [Ping timeout: 260 seconds]
ramenbytes has quit [Quit: ramenbytes]
<no-defun-allowed>
\o
<emacsomancer>
if I have 2 separate CL processes, where one is a daemonised process that's already been launched and 'listening', what would be the best way of getting the 2nd process (launched 2nd) to be able to talk to it?
<no-defun-allowed>
Maybe have the daemon listening on a named pipe (on Un*x), then have the new process write to that named pipe?
<easye>
emacsomancer: depends on what you wanna speak. A named pipe as no-defun-allowed is pretty efficient, will allow you to CL:READ/CL:WRITE objects. If speed isn't an issue, you could just establish a REST API over HTTP.
<emacsomancer>
probably the unix pipe would be best then (I'll have to look into how to talk to unix pipes)
<easye>
I find myself in need of some benchmarks for operations on Common Lisp sequence types. I am nearing completion of an overhaul of ABCL's use of arrays of primitive types with that of java.nio.ByteBuffer. Now I need to compare the two implementation strategies, and could use some sort of timing benchmark that gives the use of arrays a workout.
dawgmatix has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
sdumi has joined #lisp
<beach>
easye: Maybe you should talk to heisig. He has recently finished a complete re-implementation of the sequence functions using his novel technique of sealing. His code is entirely portable, and the performance is comparable to, or sometimes better than, that of SBCL as I understand it.
oxum_ has joined #lisp
<easye>
beach: my work is a little more basic than CLOS dealing with how byte arrays are laid out and addressed in JVM memory, but Marco is certainly the right person to ask about optimal implementation measurement. Thanks!
<beach>
Sure. Good luck.
antaoiseach has joined #lisp
emys has quit [Ping timeout: 260 seconds]
antaoiseach has left #lisp [#lisp]
oxum has quit [Ping timeout: 260 seconds]
slyrus_ has joined #lisp
<phoe>
emacsomancer: swank-crew
emys has joined #lisp
slyrus has quit [Ping timeout: 240 seconds]
<phoe>
let them talk to each other via the swank protocol.
<emacsomancer>
phoe: doesn't that depend on emacs?
<flip214>
emacsomancer: no, swank is independent of emacs. vlime and slimv (for vim) use that protocol as well.
<phoe>
emacsomancer: slime depends on emacs, swank is 100% CL
<emacsomancer>
ok
<phoe>
slime is the client, swank is the server.
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
<emacsomancer>
if I'm trying to distribute CL binaries, would swank still make sense
<phoe>
are your binaries going to talk to each other?
<emacsomancer>
yes
<phoe>
then, sure!
<phoe>
note there's no security in swank, so it needs to be secured from the outside if communication is over a network.
<emacsomancer>
would swank be more/less overhead than dealing with named unix pipes?
engblom has joined #lisp
<phoe>
slightly more, since it automatically reads/prints S-expressions.
marusich has quit [Quit: Leaving]
<phoe>
if you need to dump binary data instead of Lisp commands, then you'll prefer unix pipes with optionally swank for controlling that.
<emacsomancer>
swank does seem appealing - I just wonder if it wouldn't be overkill for what I need
<emacsomancer>
I essentially need one piece to be running as root to execute a single command (with arguments) that needs to be run as root and then other piece (as non-root) for everything else
<engblom>
Because setuid can not be used on scripts and because I have for a long time been considering to learn CL, I want to convert a simple bash script to CL. I do have Clojure background and in Clojure I would use (slurp "filename") for getting all content of a file. Is there something as simple for reading files in CL? The examples I have found by googling seems to require a lot more lines of code and it
<phoe>
isn't that just sudo?
<engblom>
becomes a bit of hazzle if you read and write to several files.
<phoe>
engblom: alexandria:read-file-into-string
<flip214>
emacsomancer: perhaps use dbus then?
<engblom>
phoe: Thanks!
<phoe>
alexandria:write-string-into-file
wxie has joined #lisp
emys has quit [Ping timeout: 265 seconds]
<phoe>
same with s/string/byte-vector/ for binary data
<emacsomancer>
flip214: well, I suppose two potential reasons against dbus: (1) it would then require users to run dbus; (2) it would require me to figure out how dbus works
emys has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
<engblom>
I have also one question more: what security problems might appear from making a CL binary program setuid? As I have understood it includes the whole lisp. Is it possible to break into a repl and run arbitary commands as root if you have used setuid?
jprajzne has quit [Quit: jprajzne]
<phoe>
engblom: if someone has access to a REPL, they own the image.
<engblom>
phoe: But will they own it as root?
<phoe>
a Lisp REPL is equivalent to a bash shell.
<phoe>
yes
<no-defun-allowed>
Yes, that is how setuid works.
<no-defun-allowed>
What do you need root for?
lerax has joined #lisp
<phoe>
if the Lisp image is owned by root, then the process has root privileges and can e.g. spawn a root bash shell, which ends the proof.
<no-defun-allowed>
If you can, give one user the special permissions you want, then setuid the image and have that user own the Lisp image.
<engblom>
phoe: So how do you reach a REPL from a compiled lisp program?
<no-defun-allowed>
Usually Control-C in the terminal will send an interrupt signal and it'll break into the debugger.
<no-defun-allowed>
Debuggers often are REPLs with some extra debugging commands.
dale has quit [Quit: My computer has gone to sleep]
<phoe>
engblom: that's a non-trivial thing. Does your Lisp image expose a swank server anywhere? Is it run in a tmux where people can use its REPL? Is it run in any sort of interactive environment where a Ctrl+C signal can invoke a debugger, as no-defun-allowed said?
<phoe>
Does your code use EVAL or COMPILE anywhere?
<phoe>
or LOAD, or COMPILE-FILE?
<selwyn>
wouldn't this approach require a slime client written in common lisp? does such a thing exist?
<phoe>
engblom: it's possible to safeguard a Common Lisp process against these things, I just still don't know why you'd need one running as root
<selwyn>
oh cool didn't know that
bebop has joined #lisp
<phoe>
I think it is used by swank-crew
<engblom>
phoe: I could solve it without setuid by writing udev rules, that is true
jprajzne has joined #lisp
varjag has joined #lisp
<engblom>
phoe: The script will read and write from files under /sys
emys has quit [Ping timeout: 260 seconds]
<engblom>
To make it more simple I would prefer to just setuid so then all I need to do is moving the binary to any system I want without also creating udev rules.
<phoe>
engblom: how should the script receive its input/output?
random-nick has joined #lisp
<engblom>
phoe: one input will be an argument to the script, the rest will come from files under /sys
<phoe>
you don't any kind of interactivity for it then
<engblom>
and the output will be written to /sys files
<engblom>
No, no interactivity is needed.
andrei-n has joined #lisp
<phoe>
install a SIGINT handler for it that will gracefully shut down the process instead of entering the debugger and/or disable the Lisp debugger inside the image
<phoe>
then the binary should be safe to be SETUID'd
oxum_ has quit [Read error: Connection reset by peer]
emys has quit [Ping timeout: 240 seconds]
emys has joined #lisp
kalogik has joined #lisp
kalogik has quit [Client Quit]
<flip214>
engblom: why not run the binary _once_ with setuid and it installs the needed udev scripts?
nikkal has joined #lisp
even4void has joined #lisp
nikkal is now known as nikka
emys has quit [Ping timeout: 260 seconds]
even4void has quit [Remote host closed the connection]
emys has joined #lisp
oxum has quit [Remote host closed the connection]
oxum has joined #lisp
pve has joined #lisp
rogersm has joined #lisp
oxum has quit [Ping timeout: 260 seconds]
dale has quit [Quit: My computer has gone to sleep]
emys has quit [Ping timeout: 272 seconds]
heisig has joined #lisp
hineios has quit [Ping timeout: 260 seconds]
shifty has quit [Ping timeout: 258 seconds]
dawgmatix has quit [Read error: Connection reset by peer]
emys has joined #lisp
nikka has quit [Ping timeout: 258 seconds]
gravicappa has joined #lisp
oxum has joined #lisp
emys has quit [Ping timeout: 264 seconds]
oxum has quit [Ping timeout: 264 seconds]
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
wxie has quit [Ping timeout: 260 seconds]
defaultxr has quit [Quit: WeeChat 2.8]
wxie has joined #lisp
emys has joined #lisp
emys has quit [Ping timeout: 272 seconds]
emys has joined #lisp
oxum has joined #lisp
rogersm has quit [Quit: Leaving...]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
bfig_ has joined #lisp
bfig has quit [Ping timeout: 265 seconds]
hineios has joined #lisp
kidejunto has joined #lisp
<kidejunto>
hello
gaqwas has quit [Changing host]
gaqwas has joined #lisp
<beach>
Hello kidejunto.
<kidejunto>
@beach can I make money with common lisp?
<beach>
Sure, if you want.
<kidejunto>
how can I do that?
<beach>
Just like you can with any other programming language, if you do something that people are willing to pay for.
gaqwas has quit [Remote host closed the connection]
<no-defun-allowed>
(defstruct money) (make-money)
<kidejunto>
how do you make money to live?
<kidejunto>
freelance or ... something ?
<beach>
kidejunto: I think those questions are too general for this channel.
<flip214>
no-defun-allowed: without a denomination, where's the value in it?
<flip214>
kidejunto: there are also companies seeking Common Lisp developers.
<kidejunto>
ok
<no-defun-allowed>
Can you live off money? In school we learnt you needed food and water and shelter and some other things to live, but I haven't heard of any species living off money.
<flip214>
no-defun-allowed: don't get too meta
<Cymew>
...and if you write the next "twitter", who cares what language you are using? Feel free to do that in CL.
<beach>
kidejunto: Now if you would like to learn Common Lisp, feel free to ask questions about it here, or in #clschool.
<no-defun-allowed>
(Remember to optimize for (speed 3) to make money fast.)
<Cymew>
:)
kidejunto has quit [Remote host closed the connection]
oxum has quit [Ping timeout: 256 seconds]
gaqwas has joined #lisp
kidejunto_asm has joined #lisp
<kidejunto_asm>
is something new here?
<phoe>
what do you mean, something new
<beach>
I am starting to think that kidejunto is a troll.
<phoe>
the only new thing I can see is the instance of 'money that no-defun-allowed just created
* no-defun-allowed
thinks she'll buy herself a football team.
<no-defun-allowed>
Well, in the past 10 minutes, you got a few answers to your question(s).
<kidejunto_asm>
is #clschool live?
<phoe>
what do you mean, live
<no-defun-allowed>
It's not dead.
<phoe>
there is people there, and people talk there
<kidejunto_asm>
I can't go in that channel
<phoe>
you'd see it if only you didn't leave that channel
<phoe>
huh?
<phoe>
10:35 -!- kidejunto_asm [7b12bca0@123.18.188.160] has joined #clschool
<phoe>
10:35 -!- kidejunto_asm [7b12bca0@123.18.188.160] has left #clschool []
<phoe>
that's from #clschool logs
<kidejunto_asm>
oh, I can't send anything to that channel
<phoe>
you might need to identify with nickserv before sending stuff
<kidejunto_asm>
ok
<phoe>
we've had bot attacks some time in the day and this was done to protect the channel from spam
kidejunto_asm has quit [Remote host closed the connection]
<phoe>
s/some time in the day/some time ago/
ghard has quit [Ping timeout: 260 seconds]
SGASAU has quit [Remote host closed the connection]
<flip214>
no-defun-allowed: you're too greedy... when converting to other types of currency, you'll overflow to +inf, and that means NaN for taxes and similar problems ;)
SGASAU has joined #lisp
<no-defun-allowed>
flip214: Really? Maybe in 2014 it would have been a problem, but now the Australian dollar is pretty weak. Let's hope the economy runs on CLISP long-floats then.
jonatack has quit [Ping timeout: 260 seconds]
emys has quit [Ping timeout: 260 seconds]
jonatack has joined #lisp
<pve>
Good morning! SBCL offers sb-introspect:function-lambda-list to get at the lambda list of a function, i.e. (sb-introspect:function-lambda-list (lambda (x y) nil)) => (x y). Do you guys happen to know if other implementations provide similar functions?
SGASAU` has joined #lisp
emys has joined #lisp
<flip214>
no-defun-allowed: I get 100AUD == 7112 Japanese Yen...
SGASAU has quit [Ping timeout: 240 seconds]
gaqwas has quit [Remote host closed the connection]
<no-defun-allowed>
trivial-arguments would likely work better.
<pve>
ah yess thank you
<phoe>
f-l-a is allowed to return NIL at any time
<phoe>
and is therefore less reliable
emys has quit [Ping timeout: 252 seconds]
SGASAU` has quit [Quit: ERC (IRC client for Emacs 26.3)]
SGASAU has joined #lisp
emys has joined #lisp
toorevitimirp has joined #lisp
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
<pve>
phoe: btw, follow-up to the restart discussion from earlier: I found that I can use a function similar to your call-with-restart to build a hashtable that associates restart names with functions that funcall a thunk with the restart established.
<pve>
So the compiler needs to be invoked only once per restart, for example by "declaring" it beforehand. I'm ok with this solution.
jonatack has quit [Ping timeout: 240 seconds]
<phoe>
pve: nice!
jonatack has joined #lisp
<phoe>
mind sharing the code?
<pve>
not at all, just a moment
vutral has quit [Ping timeout: 246 seconds]
nicktick has quit [Ping timeout: 264 seconds]
wxie has quit [Ping timeout: 260 seconds]
rogersm has joined #lisp
emys has quit [Ping timeout: 256 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
emys has joined #lisp
<pve>
phoe: i had to modify it a bit, but hopefully you get the idea
<engblom>
Why am I always ending up in the debugger when I try to do (require "project-name")
<engblom>
?
<phoe>
engblom: what's the error? (please use a pastebin)
<no-defun-allowed>
Try (ql:quickload :application-name) or (asdf:load-system :application-name)
<no-defun-allowed>
Those would probably provide a better description of what went wrong.
<engblom>
The error is System "project-name" not found
<no-defun-allowed>
What is your project called?
<engblom>
no-defun-allowed: I have several that I have tried. One is called "hello"
bebop has quit [Remote host closed the connection]
<phoe>
engblom: where are these projects located? ~/common-lisp/?
<engblom>
phoe: They are located under ~/lisp. That is where I did differ from the tutorial.
<no-defun-allowed>
What's the value of asdf:*central-registry*
<engblom>
no-defun-allowed: How do i check that?
<no-defun-allowed>
Evaluate that in the REPL.
<engblom>
(#P"/home/lars/quicklisp/quicklisp/")
<no-defun-allowed>
That would be a list of pathnames ASDF searches in, but it's deprecated and I need to find the new one.
<phoe>
try putting the project in ~/quicklisp/local-projects/
<engblom>
phoe: Is a symlink ok?
<phoe>
engblom: I think so, yes
<no-defun-allowed>
Admittedly, I don't think that cl-project sets up things very nicely. But it should work if you put it in ~/quicklisp/local-projects/.
Bourne has joined #lisp
<engblom>
That worked!
<engblom>
no-defun-allowed: What do you recommend instead of cl-project?
<no-defun-allowed>
Usually an ASDF system and directory materialises when I work on a project for long enough, but that's not a very good answer.
<phoe>
I personally use quickproject
<ralt>
engblom: "~/common-lisp/" is actually a magic path
<phoe>
it's tiny, but works for me
* no-defun-allowed
reads the tutorial series.
orivej has quit [Read error: Connection reset by peer]
<engblom>
ralt: OK! Then I should maybe rename my lisp folder
<no-defun-allowed>
"Common lisp is a set of specification and no language called common lisp itself exists" Everyone, pack it up, we've been bamboozled about the existence of Common Lisp.
<no-defun-allowed>
engblom: You probably should use QL:QUICKLOAD, because it has some more options that REQUIRE doesn't have, and will signal actually useful errors if something goes wrong.
sdumi has joined #lisp
<engblom>
no-defun-allowed: Thanks, will do that!
<no-defun-allowed>
phoe: Thanks, but please don't feel pressured to do anything if you think it's stupid stuff random people say.
<ralt>
Ignorance is not idiocy :)
<phoe>
(incf ralt)
<phoe>
no-defun-allowed: I don't feel pressured to do it; every little bit of cleanup that we do is another little bit of cleanup for the wider CL community as a whole.
<random-nick>
I have a CLOS question: if a class implements some protocol, what would be the best way to make a class which contains multiple of those classes but also implements the protocol, such that it decides use one of the contained classes to "forward" all the generic function calls?
<no-defun-allowed>
Sure.
<phoe>
random-nick: "contains" - so you mean composition instead of inheritance?
<random-nick>
phoe: yes
<random-nick>
as in a list in a slot
<ralt>
random-nick: I feel like your answer is call-next-method
<phoe>
ralt: that won't work without inheritance.
<random-nick>
ralt: that'd require I subcalss it
jeosol has quit [Remote host closed the connection]
<phoe>
random-nick: define all methods on the function of that protocol in the following way: (defgeneric operate ((thing my-thing) ...) (operate (subthing-of thing) ...))
<phoe>
s/defgeneric/defmethod/
orivej has quit [Ping timeout: 272 seconds]
orivej_ has joined #lisp
ghard has joined #lisp
<random-nick>
I guess I could make a macro that does it for gf names and lambda lists I give it
dddddd has joined #lisp
<phoe>
sure, that'll work
<phoe>
you will need to have some means of associating which GF should go to which sub-things though
scymtym_ has joined #lisp
scymtym has quit [Read error: Connection reset by peer]
<ralt>
ah, my bad
scymtym_ has quit [Remote host closed the connection]
<phoe>
random-nick: and that only works if your protocol is simple and you don't do e.g. multiple dispatch
scymtym has joined #lisp
<phoe>
and might also be tricky depending on where the thing is located on the lambda list
<phoe>
so, doable, but possibly tricky
Lycurgus has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
shifty has joined #lisp
FreeBirdLjj has joined #lisp
<phoe>
Is there any prior work to caching anonymous functions in weak hash tables?
<phoe>
More context: I'd like an anonymous function to stay live if at least one other piece of code refers directly to it. The question is of how to refer to it, since it's anonymous, and function objects cannot be dumped into FASLs so I cannot do read-eval trickery.
<ralt>
phoe: uuuh I do it all the time, whenever I make like a defcommand macro, it stores the lambda in a hashtable and the code calling a command just funcall on the hash table value
<phoe>
Like, ideally, if at least one live function contains a (gethash 'foo *cache*), I'd like the function that is stored in *cache* with key 'foo to stay live. If no function contains such a call, I'd like it to get collected.
FreeBirdLjj has quit [Ping timeout: 260 seconds]
<phoe>
ralt: I know how to do that without hash table weakness. I don't know if it's doable while also permitting automatic GC.
<ralt>
Ah, I missed the "weak" bit in your question.
* flip214
thinks about reference counting.... and immediately ducks
<engblom>
Is this possible (like ready made tools existing): I wish to have a separate REPL running outside of the editor (vim in my case) and then connect the editor to it so I can send functions and stuff to it.
<phoe>
engblom: yes, it's called slimv/vlime
<phoe>
and it's the normal way of developing Lisp
<engblom>
phoe: Isn
dxtr has quit [Ping timeout: 260 seconds]
<phoe>
end of file on #<SB-IMPL::STRING-INPUT-STREAM {1010263593}>
<engblom>
phoe: Isn't those integrating the repl into the editor itself rather than the repl running as a service outside of the editor?
dxtr has joined #lisp
<phoe>
engblom: you don't have to use that utility that way! you can run a swank server separately, and slime-connect to a running image.
<engblom>
phoe: Thanks! I have to look into that.
<phoe>
your REPL can be e.g. in a Lisp terminal, and you can use vlime to e.g. only tell the Lisp image to compile/load some files.
<phoe>
or for syntax highlighting
<engblom>
phoe: So I could add the loading of swank to my sbclrc and then connect with those vlime to it?
<engblom>
s/those//
<phoe>
yes
va_ has joined #lisp
<flip214>
engblom: vlime will run sbcl with options that load swank and the CL side of vlime for you.
orivej_ has quit [Ping timeout: 258 seconds]
<engblom>
flip214: But if I want it in a separate terminal?
orivej has joined #lisp
amerlyq has joined #lisp
va has quit [Ping timeout: 256 seconds]
SGASAU has quit [Remote host closed the connection]
dxtr has quit [Ping timeout: 260 seconds]
dxtr has joined #lisp
SGASAU has joined #lisp
ArthurStrong has joined #lisp
cmatei has quit [Ping timeout: 260 seconds]
cmatei has joined #lisp
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
cmatei has quit [Ping timeout: 256 seconds]
<flip214>
engblom: you can also run sbcl manually, start the vlime repl, and connect to the given TCP port.
<flip214>
via SSH and portforwarding, locally, or whatever you need/want.
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 272 seconds]
X-Scale` is now known as X-Scale
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
<ghard>
Heh. I'm just writing some elisp to automate running tunnels and connecting SLIME to my docker containers running lisp images at DigitalOcean to clean up my .ssh/config of all the pesky LocalForward configs.
cmatei has joined #lisp
<ghard>
Final result should be able to use org mode to view system status and connect running image with slime if necessary with a single command.
<ghard>
ralt: yes I have it run optionally depending of whether it's a development or production system. It's all baked in the makefiles that produce the executables with xach's buildapp and then dockerise.
<ghard>
I must admit I'm naughty and run swank on some production systems, too.
toorevitimirp has quit [Remote host closed the connection]
emys has quit [Ping timeout: 260 seconds]
toorevitimirp has joined #lisp
<ghard>
But with several systems it gets tedious to remember which local port maps to which remote. So now I'll have a proplist in my init.el with hostnames, ports, etc. and then should be able to invoke the tunnel and connect automagically.
<ghard>
Makes remote debugging much quicker
<ghard>
And less dangerous too :)
oxum has quit [Remote host closed the connection]
oxum has joined #lisp
<ghard>
(I admit I should probably try to customise TRAMP for that instead)
emys has joined #lisp
cmatei has quit [Ping timeout: 265 seconds]
oxum has quit [Ping timeout: 260 seconds]
EvW has joined #lisp
shifty has quit [Ping timeout: 264 seconds]
kole has joined #lisp
shifty has joined #lisp
ft has quit [Ping timeout: 272 seconds]
ft has joined #lisp
vaporatorius has quit [Read error: Connection reset by peer]
vaporatorius has joined #lisp
choegusung has joined #lisp
choegusung has quit [Client Quit]
oxum has joined #lisp
Bike has joined #lisp
cmatei has joined #lisp
<phoe>
(defun foo (&key (bar nil bar-p)) ...)
<phoe>
Can I depend on BAR-P being of type BOOLEAN?
<phoe>
...I can't
<phoe>
siiiiiigh
ArthurStrong has quit [Quit: leaving]
emys has quit [Ping timeout: 258 seconds]
<phoe>
generalized booleans strike again!
* phoe
adds this fixing to the idea bin for the Hypothetical Future Revision™
<Bike>
what's the problem with it not being t?
kole has quit [Remote host closed the connection]
<phoe>
I wish I could use this value directly as a part of an #'EQUAL hash table key
<phoe>
instead of needing to do (and bar-p t)
ldb has joined #lisp
ldb has quit [Read error: Connection reset by peer]
ppp has joined #lisp
emys has joined #lisp
<flip214>
phoe: but if you restrict the value to T or NIL anyway, why use EQUAL and not EQ? or rather, why not convert to 1 or 0 and use that as an index?
cmatei has quit [Ping timeout: 246 seconds]
cmatei has joined #lisp
<phoe>
flip214: as a *part* of an EQUAL key
shifty has quit [Ping timeout: 256 seconds]
<phoe>
I have a list key that is composed of a symbol and three booleans
<phoe>
the booleans need to be T or NIL because I won't get a hash table hit for (FOO T T T) when I send in a (FOO T T 42)
ldb has joined #lisp
shifty has joined #lisp
gko has joined #lisp
cmatei_ has joined #lisp
cmatei has quit [Ping timeout: 265 seconds]
Lycurgus has quit [Ping timeout: 264 seconds]
shifty has quit [Ping timeout: 272 seconds]
shifty has joined #lisp
ppp has quit [Remote host closed the connection]
emys has quit [Ping timeout: 265 seconds]
ech has joined #lisp
seok has joined #lisp
<seok>
Hi guys
<seok>
How would I write a macro to change (:|ts| 1388620802822 :|ask| 0.88926 :|bid| 0.88917) in to (:ts ... :ask ... :bid) ?
<seok>
bit annoying to write ||
<phoe>
seok: no need to write a macro for that
<seok>
a function can do it?
<pjb>
Of course.
lemoinem has quit [Ping timeout: 265 seconds]
APic has quit [Ping timeout: 240 seconds]
<pjb>
seok: what is :|ts|? what is :ts?
<seok>
a key?
<phoe>
(loop for (key value) on '(:|foo| 42 :|bar| 24) by #'cddr collect (intern (string-upcase key) :keyword) collect value)
<phoe>
obviously
<phoe>
this is just Lisp data
<pjb>
seok: hint: (inspect ':|ts|) (inspect ':ts)
<phoe>
;=> (:FOO 42 :BAR 24)
emys has joined #lisp
<seok>
someone told me not to write interns
<seok>
is this fine to use for many rows?
<phoe>
seok: okay then
lemoinem has joined #lisp
<Bike>
intern is how you do this.
<phoe>
(loop for (key value) on '(:|foo| 42 :|bar| 24) by #'cddr collect (alexandria:make-keyword (string-upcase key)) collect value)
<Bike>
if you don't want to use intern, avoid having this problem.
<seok>
What is wrong with using intern?
<phoe>
also, you already have interned a lot of symbols into the KEYWORD package
<seok>
Why did he tell me not to use intern
<phoe>
like :|ts|, :|ask|, :|bid|, ...
<Bike>
it's tough to say, if you don't remember anything else
<phoe>
seok: who were they and in which context was it said
ldb has quit [Quit: leaving]
<Bike>
usually something along the lines of that interning data from users is bad since the system could be overwhelmed
<seok>
yeah
<phoe>
and that is correct, if you are parsing untrusted JSON
<seok>
something about memory leak
<phoe>
that's correct
<seok>
why does it cause memory leak?
<phoe>
if users send you { "ksjdfkskshgksghsggfgfgdfgddhfgh": 42 }, you now have a keyword :|ksjdfkskshgksghsggfgfgdfgddhfgh| in your system that is going to stay there more or less forever
<phoe>
now imagine someone who sends you thousands or millions of these...
<seok>
if I use it for same keyword is it fine?
<seok>
or same symbol
APic has joined #lisp
<phoe>
yes, if you trust your JSON input
<seok>
cool
<phoe>
then INTERN finds the previous symbol with the same name in the KEYWORD package; that symbol is then returned
<seok>
does unintern reverse intern?
<phoe>
if there's any possibility of leakage, though, keep in mind that you can get your heap exhausted by people who are not very nice
<phoe>
seok: correct
<seok>
so if you unintern that is also fine
<phoe>
but you do not really which keywords are safe to remove from :KEYWORD
<phoe>
{ "TEST": 42 }
<phoe>
you really, *really* do not want to (unintern :test :keyword)
<phoe>
since that will cause Common Lisp to break horribly
<seok>
why is that? isn't it safe as long as you don't unintern from CL package?
orivej has quit [Quit: No Ping reply in 180 seconds.]
<Bike>
scheme doesn't have intern or unintern or a CL package.
* phoe
shrug
<phoe>
the standard explicitly says that if you do it, you're on your own
<seok>
well, more specifically he overwrote a function or something
<phoe>
an implementation might define such behaviour, but it's up to the implementation
<phoe>
overwriting CL functions doesn't need to work either
<seok>
Well that's interesting
milanj has quit [Quit: This computer has gone to sleep]
<lukego>
hey speaking of undefined behaviour, is there a practical way to detect when a quoted value is modified? I've always had the vague feeling that this happens often in my image and just by luck doesn't cause troubles that I notice.
<phoe>
lukego: nope.
shifty has quit [Ping timeout: 256 seconds]
<seok>
Bike phoe I feel like you are here 24/7. are you the guardians of CL?
<phoe>
at least nothing I am aware of
shifty has joined #lisp
<phoe>
seok: nah, we're just nerds
<lukego>
maybe one could make a debug build in which conses created by quote have a separate tag bit that faults on update
emys has quit [Ping timeout: 256 seconds]
<phoe>
my beard isn't even gray yet
<phoe>
lukego: and strings, and vectors, and arrays, and class instances
emys has joined #lisp
<phoe>
there's a lot of literals possible, that's the issue
<phoe>
I mean, it could be done - I don't think anyone's ever done it though
<phoe>
not in the contemporary Lisp implementations
<Bike>
you could have an implementation where literal data is stored on pages with no write access, so if you try to modify them the system traps
<phoe>
that's another way, yes
<phoe>
but I don't know if anyone does that
<_death>
it would also be nice to implement operators so that they do maximum sharing of structure and use literals if they can (looking in the direction of backquote)
<phoe>
again, implementation-dependent stuff I guess
oxum has quit [Remote host closed the connection]
APic has joined #lisp
Kundry_Wag has joined #lisp
oxum has joined #lisp
even4void has joined #lisp
<even4void>
blist
orivej has quit [Ping timeout: 258 seconds]
<phoe>
huh?
orivej has joined #lisp
<even4void>
wrong Emacs buffer ;-)
heisig has quit [Quit: Leaving]
emys has quit [Ping timeout: 265 seconds]
milanj has joined #lisp
shka_ has joined #lisp
sjl_ has joined #lisp
bitmapper has joined #lisp
emys has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
emys has quit [Ping timeout: 260 seconds]
even4void has quit [Ping timeout: 260 seconds]
shka_ has quit [Ping timeout: 272 seconds]
emys has joined #lisp
cosimone has quit [Remote host closed the connection]
cosimone has joined #lisp
shifty has quit [Ping timeout: 265 seconds]
shifty has joined #lisp
orivej has quit [Ping timeout: 256 seconds]
orivej has joined #lisp
liberliver1 has joined #lisp
liberliver has quit [Ping timeout: 260 seconds]
liberliver1 is now known as liberliver
oxum has quit [Remote host closed the connection]
oxum has joined #lisp
antaoiseach has joined #lisp
liberliver has quit [Ping timeout: 256 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
liberliver has joined #lisp
Bit_MCP has joined #lisp
oxum has quit [Ping timeout: 256 seconds]
antaoiseach has left #lisp [#lisp]
shka_ has joined #lisp
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
ft has quit [Ping timeout: 240 seconds]
rippa has joined #lisp
liberliver1 has joined #lisp
liberliver has quit [Ping timeout: 265 seconds]
liberliver1 is now known as liberliver
shifty has quit [Ping timeout: 256 seconds]
orivej_ has joined #lisp
orivej has quit [Ping timeout: 264 seconds]
shifty has joined #lisp
even4void has joined #lisp
even4void has quit [Remote host closed the connection]
ahungry has joined #lisp
Kevslinger has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
emys has quit [Ping timeout: 264 seconds]
Inline has quit [Ping timeout: 246 seconds]
bhartrihari has left #lisp ["Disconnected: Replaced by new connection"]
bhartrihari has joined #lisp
shifty has quit [Ping timeout: 260 seconds]
EvW has quit [Ping timeout: 260 seconds]
shifty has joined #lisp
jackdaniel has quit [Remote host closed the connection]
emys has joined #lisp
jeosol has joined #lisp
jackdaniel has joined #lisp
orivej_ has quit [Ping timeout: 260 seconds]
oxum has joined #lisp
orivej has joined #lisp
gaqwas has quit [Quit: Leaving]
sdumi has quit [Ping timeout: 260 seconds]
jackdaniel has quit [Remote host closed the connection]
gaqwas has joined #lisp
pjb has quit [Ping timeout: 272 seconds]
oxum has quit [Ping timeout: 256 seconds]
shifty has quit [Ping timeout: 246 seconds]
shifty has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
toorevitimirp has joined #lisp
orivej has quit [Ping timeout: 246 seconds]
orivej has joined #lisp
emys has quit [Ping timeout: 260 seconds]
emys has joined #lisp
shymega has quit [Quit: Adiós!]
oxum has joined #lisp
emys has quit [Ping timeout: 260 seconds]
toorevitimirp has quit [Remote host closed the connection]
emys has joined #lisp
orivej has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
shymega has joined #lisp
emys has quit [Ping timeout: 244 seconds]
_jrjsmrtn has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 258 seconds]
emys has joined #lisp
scymtym_ has joined #lisp
scymtym_ has quit [Remote host closed the connection]
scymtym has quit [Ping timeout: 240 seconds]
scymtym has joined #lisp
liberliver has quit [Ping timeout: 240 seconds]
emys has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
orivej_ has quit [Ping timeout: 272 seconds]
emys has joined #lisp
ft has joined #lisp
ebrasca has joined #lisp
jonatack has quit [Ping timeout: 240 seconds]
dale_ has joined #lisp
dale_ is now known as dale
jonatack has joined #lisp
dtman34 has joined #lisp
dtman34 has quit [Remote host closed the connection]
dtman34 has joined #lisp
dtman34 has quit [Remote host closed the connection]
shifty has quit [Ping timeout: 264 seconds]
shifty has joined #lisp
shifty has quit [Ping timeout: 240 seconds]
shifty has joined #lisp
nullniverse has joined #lisp
nullniverse has quit [Changing host]
nullniverse has joined #lisp
pjb has joined #lisp
sdumi has joined #lisp
Bit_MCP has quit [Ping timeout: 256 seconds]
oxum has quit [Remote host closed the connection]
dyelar has joined #lisp
paul0 has joined #lisp
orivej_ has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
Lycurgus has joined #lisp
shifty has quit [Ping timeout: 272 seconds]
shifty has joined #lisp
jackdaniel has joined #lisp
Lycurgus has quit [Remote host closed the connection]
emys has quit [Ping timeout: 260 seconds]
orivej_ has quit [Ping timeout: 260 seconds]
orivej has joined #lisp
notzmv has quit [Read error: Connection reset by peer]
emys has joined #lisp
efm has joined #lisp
oxum has joined #lisp
pjb has quit [Ping timeout: 265 seconds]
kbtr has quit [Ping timeout: 272 seconds]
kbtr has joined #lisp
marusich has joined #lisp
teej has quit [Ping timeout: 272 seconds]
CEnnis91 has quit [Ping timeout: 272 seconds]
fowlduck has quit [Ping timeout: 256 seconds]
jlpeters has quit [Ping timeout: 272 seconds]
orivej has quit [Ping timeout: 246 seconds]
drmeister has quit [Ping timeout: 260 seconds]
fowlduck has joined #lisp
orivej has joined #lisp
avicenna has quit [Ping timeout: 272 seconds]
drmeister has joined #lisp
jlpeters has joined #lisp
CEnnis91 has joined #lisp
physpi has quit [Ping timeout: 260 seconds]
fowlduck has quit [Max SendQ exceeded]
gko has quit [Ping timeout: 246 seconds]
Kaisyu has quit [Ping timeout: 260 seconds]
Kemwer_ has quit [Ping timeout: 272 seconds]
avicenna has joined #lisp
bytesighs has quit [Read error: Connection reset by peer]
CEnnis91 has quit [Ping timeout: 244 seconds]
Kevslinger has quit [Ping timeout: 260 seconds]
Kevslinger has joined #lisp
avicenna has quit [Ping timeout: 272 seconds]
bytesighs has joined #lisp
Kemwer_ has joined #lisp
avicenna has joined #lisp
shifty has quit [Ping timeout: 246 seconds]
ech has quit [Ping timeout: 256 seconds]
physpi has joined #lisp
ech has joined #lisp
physpi has quit [Max SendQ exceeded]
pjb has joined #lisp
Guest91294 has joined #lisp
jlpeters has quit [Ping timeout: 258 seconds]
sdumi has quit [Ping timeout: 260 seconds]
avicenna has quit [Ping timeout: 260 seconds]
jlpeters has joined #lisp
fowlduck has joined #lisp
physpi has joined #lisp
teej has joined #lisp
avicenna has joined #lisp
sdumi has joined #lisp
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
shangul has quit [Ping timeout: 258 seconds]
orivej has quit [Read error: Connection reset by peer]
orivej_ has joined #lisp
Bourne has quit [Remote host closed the connection]
oxum has quit [Remote host closed the connection]
Kaisyu has joined #lisp
oxum has joined #lisp
rgherdt has joined #lisp
oxum has quit [Ping timeout: 240 seconds]
jw4 has quit [Read error: Connection reset by peer]
<jackdaniel>
(doomlist (v '(1 23)) (print v)) ; 1 23
loli has quit [Ping timeout: 260 seconds]
<doomlist3>
can dolist iterate over plist
shangul has quit [Ping timeout: 258 seconds]
<dlowe>
yes, but it won't give you keys and values seperately
<dlowe>
it'll just iterate over it like any other list
<doomlist3>
format t "~{~a can ~a~% ~}" plist ; dolist says too few args
<doomlist3>
then it's iteration over list not plist
loli has joined #lisp
<dlowe>
alexandria:doplist will do what you want
<dlowe>
if you use the alexandria library
<dlowe>
otherwise you can use loop deconstruction like (loop for (k v) on plist by 'cddr do ...)
<doomlist3>
cl is fine , but with all the strangeness it's too bloated unlike python
<doomlist3>
and it's features too r bloated
<dlowe>
the strangeness is just 50 years of divergent evolution
<jackdaniel>
you may think about most of that "bloat" as a standard library which you may ignore
<doomlist3>
loop too is strange as while,for is enough
<dlowe>
well, like the standard library in python you can't actually ignore it when reading code
<jackdaniel>
(defmacro while (test &rest body) `(loop while ,test do (progn ,@body))) ; voila
<jackdaniel>
you are right, but by the time you read others code it is not bloat to you anymore
<jackdaniel>
(I think)
<dlowe>
nothing prevents you from doing it the hard way with TAGBODY, GO, IF, and SETF
<_death>
you can always define a doomlist3-lisp package with just the operators you consider essential
<jackdaniel>
don't forget about the doomlist3-lisp-user package! :)
frgo has quit []
nullniverse has quit [Quit: Leaving]
<Demosthenex>
jackdaniel: man! love the new terminal post!
oxum has joined #lisp
<jackdaniel>
Demosthenex: thanks! I'm glad you've liked it
shifty has joined #lisp
slyrus_ has quit [Remote host closed the connection]
emys has quit [Ping timeout: 260 seconds]
orivej has joined #lisp
slyrus_ has joined #lisp
<Demosthenex>
i'm all about terminals and TUIs, though i have little code to show... i read your prior cl-charms and enjoyed it, this is even more encouraging
milanj has quit [Quit: This computer has gone to sleep]
grewal has quit [Ping timeout: 260 seconds]
grewal has joined #lisp
oxum has quit [Ping timeout: 265 seconds]
emys has joined #lisp
sauvin has quit [Read error: Connection reset by peer]
bhartrihari has left #lisp ["Disconnected: closed"]
bhartrihari has joined #lisp
noobineer has joined #lisp
frgo has joined #lisp
emys has quit [Ping timeout: 240 seconds]
<Demosthenex>
wow! immediate mode too.
<jackdaniel>
that's more POC code, but since you've asked
<Demosthenex>
sure, i understand.
<jackdaniel>
_death wrote bindings for imgui in ecl
<jackdaniel>
very cool project
<Demosthenex>
nice.
<Demosthenex>
i focus strongly on terminal application due in part to input latency.
<Demosthenex>
most of my code doesn't have UI, i always write backend stuff or just solve a problem with a script... but i've frequently wanted some simple UI tools that didn't suck
<Demosthenex>
if more gui apps were immediate, i might actually use them ;]
ebrasca has quit [Remote host closed the connection]
orivej_ has joined #lisp
emys has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
<Demosthenex>
i've written several POCs for tiny DB's with simple input forms and tables in a few languages, and never found a style or TUI i liked :P
pjb has joined #lisp
<jackdaniel>
heh
shifty has quit [Ping timeout: 256 seconds]
<jackdaniel>
I need to go to spend some time with my family, thanks for encouraging words! :)
shifty has joined #lisp
<ChoHag>
Demosthenex: UIs, G and T alike, have universally sucked since Acorn and Amiga died in the 90s.
orivej_ has quit [Ping timeout: 265 seconds]
orivej has joined #lisp
bhartrihari has left #lisp [#lisp]
oxum has joined #lisp
shifty has quit [Ping timeout: 246 seconds]
shifty has joined #lisp
oxum has quit [Ping timeout: 256 seconds]
jprajzne has quit [Ping timeout: 260 seconds]
orivej has quit [Ping timeout: 246 seconds]
Bit_MCP has joined #lisp
orivej has joined #lisp
Bit_MCP has quit [Client Quit]
shangul has joined #lisp
shifty has quit [Ping timeout: 256 seconds]
shifty has joined #lisp
shangul has quit [Ping timeout: 256 seconds]
slyrus_ has quit [Quit: Leaving]
shifty has quit [Ping timeout: 265 seconds]
shifty has joined #lisp
<Demosthenex>
ChoHag: quite likely
<Demosthenex>
i just want some basic mainframe style forms for basic crap via ssh
orivej has quit [Ping timeout: 246 seconds]
efm has quit [Ping timeout: 260 seconds]
orivej has joined #lisp
rogersm has joined #lisp
davsebamse has joined #lisp
davsebam1e has quit [Read error: Connection reset by peer]
shifty has quit [Ping timeout: 256 seconds]
oxum has joined #lisp
Lycurgus has joined #lisp
oxum has quit [Ping timeout: 256 seconds]
rogersm has quit [Remote host closed the connection]
shifty has joined #lisp
<ChoHag>
Is there a standard idiom for 'evaluate to the first item of the list for which (test item) is true'?
<ChoHag>
So the answer is "No, there are several" :)
<phoe>
depends on what exactly you want to do
<phoe>
or rather, what message you want to pass to the programmer who reads your code
rogersm has joined #lisp
<phoe>
myself, I'd be somewhat surprised if someone used the return value of #'SOME in a non-boolean context
<ChoHag>
I want to pass the message that the expression 'evaluate[s] to the first item of the list for which (test item) is true'.
<phoe>
I'd expect FIND-IF in such position
<_death>
some would return the predicate's value, not the list item
rogersm has quit [Client Quit]
lucasb has joined #lisp
rogersm has joined #lisp
<phoe>
oh right!
<phoe>
that's why I would be surprised by it
anticrisis has joined #lisp
rogersm has quit []
orivej has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
<Josh_2>
evenin'
oxum has joined #lisp
rogersm has joined #lisp
rozenglass has quit [Ping timeout: 256 seconds]
<ChoHag>
How can I load a module from ~/src that began its life in quicklisp's storage area?
rozenglass has joined #lisp
<Josh_2>
symlink in local-projects to ~/src ?
<ChoHag>
I was hoping for something less hacky.
<Josh_2>
That's what you have to do if you want quicklisp to pick up projects outside of local-projects
<ChoHag>
It can't take a one-off absolute path? Or be bypassed by something that can?
rogersm has quit [Remote host closed the connection]
rogersm has joined #lisp
cosimone has quit [Quit: Quit.]
ArthurStrong has joined #lisp
bfig has joined #lisp
oxum has quit [Ping timeout: 272 seconds]
bfig_ has quit [Ping timeout: 260 seconds]
shka_ has quit [Ping timeout: 265 seconds]
Kundry_W_ has joined #lisp
oxum has joined #lisp
ArthurStrong has quit [Quit: leaving]
Kundry_Wag has quit [Ping timeout: 246 seconds]
oxum has quit [Ping timeout: 265 seconds]
ArthurStrong has joined #lisp
<ralt>
luis: when should I remind you guys of open PRs? there's one open 4 days ago, don't wanna be a bother, also don't wanna get it forgotten :) let me know how often, even if it's "don't", I should send a friendly reminder.
<ralt>
I know that being an open source maintainer is a pain etc etc. so it's really a "let me know" kinda thing.
<jackdaniel>
since we are at it :)
<jackdaniel>
fe[nl]ix: ping about mailboxes :)
orivej has quit [Ping timeout: 272 seconds]
orivej has joined #lisp
cmack` has joined #lisp
cmack has quit [Ping timeout: 260 seconds]
orivej_ has joined #lisp
orivej has quit [Ping timeout: 265 seconds]
Lycurgus has quit [Remote host closed the connection]
elflng has quit [Quit: leaving]
rogersm has quit [Remote host closed the connection]
Jesin has quit [Quit: Leaving]
efm has joined #lisp
karayan has quit [Remote host closed the connection]
karayan has joined #lisp
dyelar has quit [Quit: Leaving.]
pjb has quit [Ping timeout: 272 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Jesin has joined #lisp
<phoe>
Xach: beep boop
orivej_ has quit [Quit: No Ping reply in 180 seconds.]
orivej has joined #lisp
rumbler31 has joined #lisp
<seok>
What is the most performant way of removing the last item in a list?
<phoe>
how often are you going to do that?
<ralt>
seok: BUTLAST?
<seok>
bout 3 million times
doomlist3 has quit [Ping timeout: 246 seconds]
<phoe>
use a doubly linked list
jonatack has quit [Ping timeout: 260 seconds]
<seok>
What is that?
<ralt>
probably don't use a normal linked list if performance matters to you
<phoe>
a list in which each node holds references to both its successor and predecessor
shifty has quit [Ping timeout: 260 seconds]
<phoe>
unlike a standard singly linked list, which only refers to the next cell
<seok>
Is there a tutorial on it?
<seok>
or perhaps a library?
<phoe>
with such a list, you usually have pointers to the first and last element, and you can pop from either side
<phoe>
axion: I got a customer for ya
jonatack has joined #lisp
<seok>
3
dmiserak has joined #lisp
<seok>
3 million should be fine with just normal list, but I want to learn techniques as I code : )
<seok>
ralt
<phoe>
what is your algorithm and why do you need to pop stuff so often
<White_Flame>
could you switch to arrays?
<phoe>
seok: (ql:quickload :doubly-linked-list)
<White_Flame>
could you hold your list reversed, so that you only pop the head?
<seok>
Ah yes I could use arrays since the size remains constant
<phoe>
seok: wait a second
<phoe>
how can it remain constant if you pop stuff
<seok>
I need to shift items just as many times though
<seok>
I add one to the front
<seok>
FILO?
<phoe>
oh! so a queue
<seok>
FOLI? more like
<seok>
yes
ahungry has quit [Remote host closed the connection]
orivej has quit [Quit: No Ping reply in 180 seconds.]
<seok>
you are right it is a queue
<phoe>
seok: (ql:quickload :doubly-linked-list)
<seok>
that's good for queues too?
<White_Flame>
the most performant way to write queues of unbounded size is to use multiple buffers
<phoe>
it'll work, I don't know how performant it will be
<seok>
the size is bound
<seok>
size will remain constant
orivej has joined #lisp
<White_Flame>
an easy but still performant way is to use 2 lists: the input list conses to the head. When you want to read, reverse the list once and pop items from the head, writing to a new input list
<seok>
definitely faster than standard list though right phoe?
<phoe>
popping the last element is linear instead of quadratic
<phoe>
so, yeah, I guess
<phoe>
I mean, uhhhh
<phoe>
constant instead of linear
ghard has quit [Ping timeout: 260 seconds]
<seok>
White_Flame I need to read and write the same 3 million times, would that still be ok?
<White_Flame>
popping the last element of the list also causes GC pressure (on plain cons lists) as the rest of it needs to be copied
<phoe>
White_Flame: not if you mutate the list
<White_Flame>
true
<phoe>
copying 3M conses on each pop would be unbearable
<White_Flame>
ah, nbutlast does exist
<seok>
yes, but I am not sure if it is performant
<White_Flame>
but still, the two-list scheme that I mentioned would perform the occasional NREVERSE
<seok>
I know CL list is not good at looking up last item
<White_Flame>
and the rest is single-cons head operations
<phoe>
I suggest you use doubly linked lists and check if that is good enough for you
<phoe>
if yes, all's good
<phoe>
if no, optimize further
<seok>
Yeah I am reading the manual atm
<seok>
thank you
sth_ has left #lisp ["WeeChat 1.9.1"]
<seok>
There are queue libraries, are they any good?
<White_Flame>
I would hope that anybody who actually has published a queue library would use a reasonable algorithm
<seok>
me too : D
<White_Flame>
however, you need to be familiar with how the various implementation schemes actually work to make a valid judgement of how applicable it is to your specific problem, or just start testing random ones
<White_Flame>
for basic use, the two-list scheme is easy and fast
<ChoHag>
White_Flame: Which internet are you on then?
<White_Flame>
huh?
<ralt>
the 7th one.
<ChoHag>
This internet of yours where people occasionally consider writing good code.
<White_Flame>
ah, heh
pjb has joined #lisp
<White_Flame>
the smaller the library, the more justification it needs to be worth being a library. (Unless you're using javascript, enjoy your left_pad)
<White_Flame>
and that's certainly part of lisp culture, it's so easy to write code, that doing something specific to your project is easy enough to describe, vs creating, maintaining, and pointing people to libraries
<White_Flame>
for little bits & bobs like this
<ChoHag>
What part of that is lisp-specific?
<ChoHag>
Nothing does NIH like the software industry.
<White_Flame>
implementation specifics of a queue in lisp?
<White_Flame>
and the scope of roll-little-utility-yourself is larger in lisp than in most other languages
<ChoHag>
You may be affected by confirmation bias there.
gravicappa has quit [Ping timeout: 272 seconds]
orivej has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
<White_Flame>
I believe I have enough languages under my belt to have a good sense of Lisp's standing in that
random-nick has quit [Ping timeout: 264 seconds]
<White_Flame>
but it certainly is also a language community culture that affects that as well; JS is fairly easy to write little bits & bobs in, but you still end up with leftpad and if you're tied up in frameworks then your "small utilities" have to play along with larger infrastructure, which inflates the size of utilities
<phoe>
tl;dr of the issue: we would like ASDF to warn if a library pollutes the global readtable, and this most likely requires scanning the Quicklisp world for libraries which do so and fixing them up.
<phoe>
And we'll need your help with that!
<ralt>
you can't run quicklisp on your own?
<phoe>
I guess I could, but I don't have the machine to load every Quicklisp library available.
<ralt>
you need a special one for this?
<phoe>
AFAIR there's no public code that allows one to create a Linux+SBCL VM that mimics the environment Quicklisp uses for performing its tests.
<phoe>
ralt: yes, one with all the foreign libraries installed
<ralt>
I guess I only tried to download all of them, not load them