thecoffemaker has quit [Quit: So long and thanks for all the fish!]
marusich has quit [Ping timeout: 258 seconds]
thecoffemaker has joined #lisp
thecoffemaker is now known as thecoffem
varjag has quit [Ping timeout: 256 seconds]
kaftejiman has quit [Remote host closed the connection]
Fare has joined #lisp
thecoffem has quit [Quit: So long and thanks for all the fish!]
marusich has joined #lisp
skapata has joined #lisp
Jeanne-Kamikaze has quit [Quit: Leaving]
Jeanne-Kamikaze has joined #lisp
thecoffemaker has joined #lisp
<fiddlerwoaroof>
easye: org-mode is great, I find there's too much ceremony for getting my thoughts into the computer when I'm in the flow
<fiddlerwoaroof>
(coding, that is)
rumbler31 has joined #lisp
rumbler31 has quit [Remote host closed the connection]
thecoffemaker has quit [Quit: So long and thanks for all the fish!]
rumbler31 has joined #lisp
thecoffemaker has joined #lisp
jibanes has quit [Ping timeout: 240 seconds]
badcfe has joined #lisp
jibanes has joined #lisp
gzj has joined #lisp
gzj has quit [Remote host closed the connection]
gzj has joined #lisp
EvW has quit [Ping timeout: 258 seconds]
thecoffemaker has quit [Quit: So long and thanks for all the fish!]
ralt has quit [Quit: Connection closed for inactivity]
Lord_of_Life has joined #lisp
Lord_of_Life_ has quit [Ping timeout: 240 seconds]
orivej has quit [Ping timeout: 240 seconds]
perrier-jouet has quit [Ping timeout: 260 seconds]
thecoffemaker has joined #lisp
<emacsomancer>
fiddlerwoaroof: org-capture templates make it a lot easier to quickly dump from short-term wetware memory into org
thecoffemaker has quit [Max SendQ exceeded]
lilgopher has joined #lisp
jcguu95 has quit [Quit: ERC (IRC client for Emacs 27.1)]
<fiddlerwoaroof>
emacsomancer: yeah, my problem is different: scratch-style code evaluation is great for quickly iterating to a solution to a set problem
perrier-jouet has joined #lisp
jibanes has quit [Ping timeout: 258 seconds]
<fiddlerwoaroof>
org SRC blocks also work, but I've found them a bit awkward during the prototyping phase
nij has joined #lisp
<emacsomancer>
fiddlerwoaroof: I see. so not the initial creation of the blocks, but subsequent interactions?
hiroaki has quit [Ping timeout: 272 seconds]
jibanes has joined #lisp
aeth has quit [Ping timeout: 265 seconds]
aeth has joined #lisp
defunkydrummer has quit [Ping timeout: 264 seconds]
jxy has quit [Quit: leaving]
jxy has joined #lisp
rumbler31 has quit [Remote host closed the connection]
thecoffemaker has joined #lisp
sgibber2018 has joined #lisp
wildlander has joined #lisp
elflng has joined #lisp
thecoffemaker has quit [Quit: So long and thanks for all the fish!]
thecoffemaker has joined #lisp
<fiddlerwoaroof>
emacsomancer: yeah, I really like org-mode for documentation and "blogging" about code.
zulu-inuoe has quit [Read error: Connection reset by peer]
gzj has quit [Remote host closed the connection]
gzj has joined #lisp
eden has joined #lisp
<mister_m>
I saw it mentioned in the upscroll; is the book lisp in small pieces suitable for someone relatively new to lisp?
<Bike>
probably not, honestly
jibanes has quit [Ping timeout: 240 seconds]
thecoffemaker has quit [Read error: Connection timed out]
jibanes has joined #lisp
lilgopher has quit [Ping timeout: 258 seconds]
thecoffemaker has joined #lisp
thecoffemaker has quit [Max SendQ exceeded]
<mister_m>
Bike: thanks
thecoffemaker has joined #lisp
gzj has quit [Ping timeout: 258 seconds]
aeth has quit [Ping timeout: 256 seconds]
semz has quit [Ping timeout: 260 seconds]
aeth has joined #lisp
thecoffemaker has quit [Quit: So long and thanks for all the fish!]
thecoffemaker has joined #lisp
<thmprover>
I'm actually having some difficulty getting into the hang of literate programming in org-mode.
<lotuseater>
so what problem specifically?
<thmprover>
Literate programming (in the Knuth sense) is difficult, but getting org-mode to export the correct HTML is tedious. It feels like I'm fighting against the tide.
<lotuseater>
do you know pandoc?
<thmprover>
Yes, I dislike it.
<lotuseater>
why?
semz has joined #lisp
<thmprover>
I take advantage of a lot of custom TeX macros, and they don't play nice with pandoc.
abhixec has joined #lisp
<lotuseater>
ah yes that's a tradeoff
<thmprover>
I mean, I can see pandoc's appeal to the generic user, but I'm the "crazed TeX survivalist"-type user.
<no-defun-allowed>
Yes, pandoc doesn't properly run TeX. So I use htlatex and fix up a bit of the nonsense it emits with a script that runs sed.
jibanes has quit [Ping timeout: 240 seconds]
<thmprover>
I'm starting to explore htlatex to translate this manuscript I'm writing on theorem provers to HTML, it's a nifty program, but so...niche.
<lotuseater>
a friend of mine also showed me this half a year ago, maybe it's of use for anyone else: https://latex.now.sh/
jibanes has joined #lisp
<lotuseater>
no-defun-allowed: nice look!
<no-defun-allowed>
It seems likely thmprover wants to use a LaTeX document to make HTML.
<thmprover>
lotuseater: the rendering is, I can't quite put my finger on it, the fonts are slightly mismatched. The CMR is too light compared to the monotype font weight.
<lotuseater>
ok
<thmprover>
It's nifty, but not for me.
<lotuseater>
how do i in org-mode set globally to tangle all blocks? except the ones with ":tangle no"
nij has quit [Remote host closed the connection]
<thmprover>
"#+OPTION: :tangle <file>"
jibanes has quit [Ping timeout: 240 seconds]
<thmprover>
(I think)
<lotuseater>
ah yes thx
<thmprover>
np
<lotuseater>
just taking org-mode and all its features is soo much :D
jibanes has joined #lisp
<thmprover>
I'm trying to work with it to write my notes on earth science, but it's...I don't know...
<thmprover>
I sense I am doing things wrong with org-mode, but I don't know what "doing things right" looks like, and the only talks on it seem to be excited users talking about how great it is.
<thmprover>
Maybe I should go complain on #org-mode about org-mode
akoana has left #lisp ["Leaving"]
<fiddlerwoaroof>
Hmm, I used custom TeX macros all the time with pandoc
<thmprover>
fiddlerwoaroof: I'm doing pretty tricky macro stuff, which takes advantage of the dynamic scoping of TeX (and I think confuses pandoc)
<fiddlerwoaroof>
Interesting
<fiddlerwoaroof>
The most complicated I had were Tikz diagrams
PuercoPop has joined #lisp
<fiddlerwoaroof>
But, I was writing humanities papers, which are somewhat less involved
skapata has quit [Remote host closed the connection]
<no-defun-allowed>
Well, I don't know if pandoc does any macroexpansion. It just ignored my \Defun commands.
Jeanne-Kamikaze has quit [Quit: Leaving]
<fiddlerwoaroof>
Yeah, I mostly relied on latex being passed through in md -> latex conversion
<fiddlerwoaroof>
I've never tried latex as an input format
loke has quit [Remote host closed the connection]
loke has joined #lisp
asarch has quit [Remote host closed the connection]
<fiddlerwoaroof>
One thing I find interesting about SLIME, is that it doesn't seem to make much use of generic functions or EIEIO
<fiddlerwoaroof>
Maybe it's too old, but I've found it pretty useful for managing my emacs configuration
<fiddlerwoaroof>
(eq it 'SLIME)
waleee-cl has quit [Quit: Connection closed for inactivity]
hvxgr has quit [Remote host closed the connection]
phadthai has joined #lisp
dmiles has joined #lisp
aaaaaa has joined #lisp
terrorjack has quit [Remote host closed the connection]
jibanes has quit [Ping timeout: 240 seconds]
jibanes has joined #lisp
orivej has joined #lisp
Bike has quit [Quit: Lost terminal]
jibanes has quit [Ping timeout: 272 seconds]
jibanes has joined #lisp
<saganman>
Morning beach
<saganman>
Morning Everyone!
<beach>
Hello saganman.
<saganman>
Hey beach.
jibanes has quit [Ping timeout: 258 seconds]
jibanes has joined #lisp
notzmv has quit [Remote host closed the connection]
zcheng3 has quit [Quit: leaving]
gzj has joined #lisp
a0 has quit [Ping timeout: 240 seconds]
jibanes has quit [Ping timeout: 258 seconds]
PuercoPop has quit [Remote host closed the connection]
gzj has quit [Remote host closed the connection]
jibanes has joined #lisp
aaaaaa has left #lisp [#lisp]
astronavt has quit [Quit: ...]
MightyJoe has joined #lisp
galex-713 has quit [Ping timeout: 272 seconds]
jibanes has quit [Ping timeout: 240 seconds]
cyraxjoe has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
dmiles has quit [Remote host closed the connection]
dmiles has joined #lisp
galex-713 has joined #lisp
uniminin has joined #lisp
sgibber2018 has quit [Quit: WeeChat 2.9]
imode has quit [Ping timeout: 260 seconds]
abhixec has quit [Ping timeout: 240 seconds]
jibanes has quit [Ping timeout: 265 seconds]
gutter has quit [Remote host closed the connection]
jibanes has joined #lisp
<badcfe>
in 'on lisp' fig 14.3 there's a aif2 that seems wrong to me. but i see this is not in the errata, and i'm not really a lisper, hence i am guessing i'm wrong
<beach>
Let me check
<badcfe>
on the forth line there, i see (if (or it ,win) ,then ,else)) .. and i am thinking it should be (if ,win ,then ,else)
<beach>
I guess that depends on how he specified what should happen with the values of the test.
frost-lab has joined #lisp
<badcfe>
yes, and it's not even specified, but there's also a usage example, which makes me think what i mention here
<badcfe>
s/even/only/
wxie has joined #lisp
<badcfe>
s/forth/fourth/
<badcfe>
late for me. sorry
<beach>
Ah, yes, let me look at the example.
<beach>
Won't the two versions have the same effect for GETHASH.
<beach>
?
<beach>
If the first value is true, then so is the second.
<beach>
But, yes, I think you may be right.
<beach>
Then, I just barely finished my morning coffee, so opinions of others are welcome.
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
<beach>
It was a while ago that I read On Lisp, but now I see that AIF2 solves a major problem with the single-value version, namely that, if you respect the advice of Norvig and Pitman of using only Boolean expressions as the test in IF, then the "IT" of AIF will never be a useful value.
<badcfe>
i see now, that it doesn't matter, because both are null iff we shall branch to ,else -- if we can assume that any function indicating not-found on second return value will always have a null first return value as well, in other words that we have a functional dependency (sorry to use database theory term here). however, i think my variant is more intuitive in addition to be shorter
<beach>
I agree with your assessment.
<badcfe>
hey thanks. maybe i should submit as errata.
<beach>
Sure. It can't hurt.
<badcfe>
about that advice you mention, you suggest it as practice? i'm just curious
<beach>
Which one?
thmprover has quit [Read error: Connection reset by peer]
<beach>
I try as much as possible to follow the advice of page 13 of the LUV slides by Norvig and Pitman, if that's what you are asking.
thmprover has joined #lisp
jibanes has quit [Ping timeout: 272 seconds]
<beach>
So yes, I use only Boolean values for tests.
<badcfe>
yes, that's what i was asking. i guess my next read should be LUV
thmprover has quit [Client Quit]
<beach>
I like it very much. It was written by two people with a lot more experience with software development in larger teams than I will ever have.
jibanes has joined #lisp
<beach>
Many #lisp participants contest their advice, but I think I know for a fact that the people who do contest it have way less experience than these two people have.
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #lisp
a0 has joined #lisp
a0 has quit [Remote host closed the connection]
a0 has joined #lisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
badcfe has quit [Quit: Lost terminal]
skapata has joined #lisp
jibanes has quit [Ping timeout: 246 seconds]
jibanes has joined #lisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
gaqwas has joined #lisp
housel has quit [Read error: Connection reset by peer]
Oladon has quit [Quit: Leaving.]
aartaka has joined #lisp
gaqwas has quit [Remote host closed the connection]
theBlackDragon has quit [Ping timeout: 272 seconds]
<fiddlerwoaroof>
Obviously, with the LABELS implementation I can just use a block, but this is just for convenient prototyping
<fiddlerwoaroof>
The lines beginning with `>>>` show every invocation of the inner function in TAKING
<fiddlerwoaroof>
TAKING is supposed to only process N elements of the collection being worked on, and ignore the rest
<phoe>
is the second code block good then? the outut seems consistent with what is processed
<fiddlerwoaroof>
Yeah, THROW allowed me to implement EXIT-EARLY
<phoe>
yes
<phoe>
the only other option is to pass a closure all the way to TAKING, which might or might not be viable in your case
<phoe>
or use conditions, which will be slower.
<phoe>
so THROW seems like a decent fit in this case
<fiddlerwoaroof>
Yeah, I thought of conditions but those also just feel semantically wrong for this
<fiddlerwoaroof>
maybe a signal that doesn't inherit from condition would be ok
pve has joined #lisp
jibanes has quit [Ping timeout: 265 seconds]
<phoe>
you mean from warning/error?
<phoe>
all conditions, by definition, inherit from type CONDITION
<phoe>
and those non-error ones would be semantically valid to use here
<fiddlerwoaroof>
Sorry, I think I was confused
<phoe>
you signal a situation that you found a match of some sort
<fiddlerwoaroof>
Yeah, I meant using SIGNAL instead of ERROR/WARN
<phoe>
and it's up to the code around this call to handle or ignore it. this includes optionally performing a non-local jump.
jibanes has joined #lisp
<phoe>
so using HANDLER-CASE over SIGNAL would be equivalent to THROW/CATCH, but also very likely it would be slower because of walking the handler stack and performing runtime type checks.
<phoe>
so you're good with THROW/CATCH in this case, it seems like the proper primitive for bailing out early in this case.
Nilby has joined #lisp
<fiddlerwoaroof>
Yeah, I just never actually think about it
<phoe>
well now you did think about it, most likely because you actually found a use case for it
<phoe>
and CL delivers. :D
<fiddlerwoaroof>
One reason I like CL is that every programmer/team has their own dialect
<fiddlerwoaroof>
This is true in most languages, but I find the variations in CL more interesting
<phoe>
that's both a boon and a challenge
amb007 has quit [Read error: Connection reset by peer]
<phoe>
synchronizing different minds is real tricky in Common Lisp because of that trait.
amb007 has joined #lisp
sgibber2018 has joined #lisp
<no-defun-allowed>
Hypothetically, you at least have a definition of all the dialect-y stuff in a common language, which may not be the case for human languages.
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<beach>
ldb: I suggest you save as a Common Lisp data structure so that you can just do a READ.
<ldb>
it is due to the data structure I use requires a lot of comparison between nodes when build from a list of sorted words
<phoe>
ldb: what is your data structure?
<beach>
ldb: So don't build it every time you load it.
harlchen has joined #lisp
<beach>
ldb: Build it once from the source data, and save the built data structure using PRINT.
<phoe>
beach: currently, Spell saves it to a FASL. It has no facilities for printing that data.
<Nilby>
as you may known, things with lists can unintentionally get O(n^2) or worse very quickly
<ldb>
it requires 2 minitues on a test input of 10,000 words, but my actual input is 500,000 words, and building from larger dictionary takes extra comparsions
<beach>
ldb: Maybe you have some non-linear algorithm in your build code.
<ldb>
beach: yes, I realized every time a new node is added it has to be compared by almost every existed nodes, to minimize the data structure
waht has joined #lisp
<beach>
Not surprising then.
waht has quit [Client Quit]
<phoe>
that's painful - and O(n²)
<ldb>
ok, instead of a naive list, I can keep a lookup table with a bool and the number of children as index keys to do a pre-filtering
checco has joined #lisp
checco has quit [Remote host closed the connection]
wxie has quit [Read error: Connection reset by peer]
wxie has joined #lisp
<ldb>
is there a quick way to compare two assoc lists? the order doesn't matter, then only requirement is that each pair with #'eql keys should be has #'eq values
<ldb>
and the number of pairs are same
wxie has quit [Client Quit]
olle has joined #lisp
<fiddlerwoaroof>
compare?
<Nilby>
Usually if you have more than about 12 elements in a alist it will be faster with a hash table.
<fiddlerwoaroof>
You're going to have to check every key/value pair, no?
<fiddlerwoaroof>
It'll be O(n) regardless
<ldb>
*check equality
<ldb>
Nilby: mostly 1~5 pairs
leo_song has quit [Read error: Connection reset by peer]
dmiles has quit [Ping timeout: 240 seconds]
dmiles has joined #lisp
liberliver has joined #lisp
narimiran has quit [Ping timeout: 264 seconds]
liberliver1 has joined #lisp
liberliver has quit [Ping timeout: 272 seconds]
liberliver1 is now known as liberliver
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
uniminin has quit [Quit: Leaving]
jibanes has quit [Ping timeout: 246 seconds]
jibanes has joined #lisp
<Nilby>
Hmm. I have 1gb databse with 10m words that takes about 20 secs to load and full regexp search, and I thought it's way too slow.
varjag has joined #lisp
<ldb>
1gb takes long time to do IO
marcoxa has joined #lisp
hiroaki has joined #lisp
heisig has joined #lisp
<Nilby>
The raw IO for 1gb only takes about 1.6 secs for me, and that's longer than it should.
<Nilby>
(on an old laptop, but with an ssd)
jibanes has quit [Ping timeout: 246 seconds]
leo_song has joined #lisp
mokulus has quit [Quit: WeeChat 2.9]
jibanes has joined #lisp
a0 has quit [Remote host closed the connection]
andreyorst has joined #lisp
surabax has joined #lisp
jrm has quit [Ping timeout: 258 seconds]
rgherdt has joined #lisp
karlosz has quit [Quit: karlosz]
frgo_ has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
olle has quit [Ping timeout: 246 seconds]
frgo has quit [Ping timeout: 258 seconds]
random-nick has joined #lisp
Inline has joined #lisp
dolphin5430 has joined #lisp
dolphin5430 has quit [Client Quit]
wildlander has quit [Quit: Konversation terminated!]
aindilis has quit [Read error: Connection reset by peer]
vegansbane6 has joined #lisp
ldb has quit [Quit: ERC (IRC client for Emacs 26.1)]
liberliver1 has joined #lisp
liberliver has quit [Read error: Connection reset by peer]
liberliver1 is now known as liberliver
orivej has joined #lisp
iskander- has quit [Quit: bye]
iskander has joined #lisp
surabax_ has joined #lisp
surabax has quit [Ping timeout: 272 seconds]
frgo has joined #lisp
frgo_ has quit [Ping timeout: 264 seconds]
heisig has quit [Ping timeout: 272 seconds]
EvW has joined #lisp
akrl has quit [Read error: Connection reset by peer]
akrl has joined #lisp
aartaka_d has joined #lisp
kaftejiman has joined #lisp
aartaka has quit [Ping timeout: 240 seconds]
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 240 seconds]
iskander has quit [Ping timeout: 240 seconds]
iskander has joined #lisp
CEnnis91 has quit [Ping timeout: 260 seconds]
<marcoxa>
Just pitched in some Euros for CLCS :)
villanella has joined #lisp
<phoe>
<3
<marcoxa>
I swear. It'a a gift for my mother in law :)
austincummings[m has quit [Ping timeout: 260 seconds]
ms[m] has quit [Ping timeout: 260 seconds]
heisig has joined #lisp
ms[m] has joined #lisp
austincummings[m has joined #lisp
<phoe>
does your mother in law know Lisp?
CEnnis91 has joined #lisp
lotuseat` has joined #lisp
<marcoxa>
she know how to order people around.
lotuseater has quit [Ping timeout: 272 seconds]
Fare has quit [Ping timeout: 264 seconds]
puchacz has joined #lisp
<puchacz>
hi, is hash-table in abcl synchronized?
surabax_ is now known as surabax
ggole has joined #lisp
toorevitimirp has joined #lisp
gzj has joined #lisp
matzesc has joined #lisp
<Nilby>
puchacz: It looks synchronized to me from reading the code, but I haven't tried it. If you want your code to work on other implementations you could wrap in bordeaux-threads:with-lock-held .
<puchacz>
Nilby - thanks
<puchacz>
the manual does not say anything, but the code is better than manual
<puchacz>
and yeah, wrapping with bt will solve ambiguities
hvxgr has joined #lisp
<Nilby>
The problem is it's still a race condition if your code does a (gethash val table) and then later does a (setf (gethash val table) ..) presuming the results of the previous gethash are still valid.
Inline has quit [Ping timeout: 258 seconds]
<puchacz>
yes
Fare has joined #lisp
<Nilby>
I looked in abcl/src/org/armedbear/lisp/HashTable.java in case you want to check.
<puchacz>
tks
lucasb has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
toorevitimirp has joined #lisp
gzj has quit [Remote host closed the connection]
gzj has joined #lisp
gzj has quit [Remote host closed the connection]
gzj has joined #lisp
gzj has quit [Remote host closed the connection]
gzj has joined #lisp
aindilis has joined #lisp
gzj has quit [Remote host closed the connection]
<phoe>
puchacz: hmmmm, maybe easye can answer that
gzj has joined #lisp
toorevitimirp has quit [Remote host closed the connection]
gzj has quit [Remote host closed the connection]
gzj has joined #lisp
<puchacz>
phone - if undocumented, for more serious work I would rather wrap it
<phoe>
so would I, yes
<phoe>
but still, maybe that needs to be clarified in the abcl docs.
aartaka_d has joined #lisp
gzj has quit [Remote host closed the connection]
gzj has joined #lisp
aartaka has quit [Ping timeout: 272 seconds]
<puchacz>
sorry, Michał, typo, "phoe" of course :)
gzj has quit [Remote host closed the connection]
gzj has joined #lisp
aartaka has joined #lisp
aartaka_d has quit [Ping timeout: 240 seconds]
nwoob has joined #lisp
<phoe>
:D
sgibber2018 has quit [Quit: WeeChat 2.9]
ym has joined #lisp
liberliver has quit [Ping timeout: 260 seconds]
<nwoob>
is there a better programming experience for CL from emacs?
<beach>
Better than what?
<nwoob>
better than emacs
<beach>
Oh, better THAN Emacs?
<beach>
Not at the moment I think.
<beach>
But we are working on it. :)
<phoe>
nwoob: depends on your definition of "better"
<beach>
Give us few more years.
<phoe>
there are swank/sly clients for VSCode, Atom, and Sublime Text
<phoe>
there's also slimv/vlime for Vim.
<nwoob>
I looked how to compile CL program and found C-c C-k to evaluate buffer, but C-c C-k is undefined
<beach>
Are you using SLIME?
<nwoob>
yes
<nwoob>
I have a scratch opened and it says Lisp interaction at the bottom right
<nwoob>
in there i'm typing CL code and trying to compile the function so that I can use that function in aline-repl
<beach>
No, it should be a buffer *slime-repl...*
<phoe>
you should be able to type something in the scratch buffer, like (defun foo (x) (+ x 42)) and then hit C-c C-c on it
narimiran has joined #lisp
<phoe>
it should get compile-and-loaded and you should be able to call (foo 24) in the REPL.
EvW has quit [Ping timeout: 264 seconds]
<nwoob>
phoe: that's what I'm trying to do. but C-c C-k is undefined
<beach>
nwoob: That command is valid in a Lisp source code buffer.
<phoe>
in the lisp buffer, M-x lisp-mode <RET>
<beach>
nwoob: In the REPL buffer, just type forms.
heisig has quit [Ping timeout: 256 seconds]
gzj has quit [Ping timeout: 240 seconds]
EvW has joined #lisp
hendursa1 has quit [Quit: hendursa1]
<marcoxa>
Where can I find a link for swank/slime for VS Studio 2019?
hendursaga has joined #lisp
<nwoob>
Turns out I need to save scratch buffer code. I saved code in test.lisp and then did C-c C-k and it is working
<nwoob>
I thought I could evaluate buffer without saving
<phoe>
only individual expressions within a buffer
<phoe>
C-c C-c should work in there
<phoe>
but C-c C-k requires a saved file.
<nwoob>
in scratch buffer, right
<marcoxa>
Thanks phoe
<nwoob>
which emacs puts by default in lisp mode
<hendursaga>
Besides SBCL, what other implementations have the disassemble function disassemble to assembly language, not bytecode or C?
<phoe>
CCL?
X-Scale` has joined #lisp
<puchacz>
btw, why do people choose CCL over SBCL?
<phoe>
blazing fast compiler compared to SBCL's
Fare has quit [Ping timeout: 260 seconds]
<phoe>
also a nice macOS IDE built-in.
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
<phoe>
and AFAIK some Cocoa/ObjC bindings that SBCL does not have.
<Nilby>
CCL aslo has no memory limits, and can call C code with structs by value without libffi
<hendursaga>
sounds cool
<beach>
hendursaga: I would think any Common Lisp implementation that generates native code would disassemble to assembly language for the platform it is running on.
EvW has quit [Ping timeout: 258 seconds]
hineios has quit [Ping timeout: 265 seconds]
<hendursaga>
so I guess that excludes ECL then
<beach>
Good question. I suppose jackdaniel would know since he is the maintainer of ECL
<hendursaga>
I tried it and it outputs C code, so unless there's an additional setting somewhere..
waleee-cl has joined #lisp
<nwoob>
it is bad programming style to change local variable values, so why is it ok to change global variable values?
<beach>
It is not bad to change the value of lexical (local) variables.
<phoe>
nwoob: what do you mean, change?
<phoe>
you mean mutate or rebind?
<beach>
nwoob: It is known as "imperative programming".
<nwoob>
mutate
<nwoob>
I'm learning CL from book called CL: a gentle guide to symbolic programming and it is written there
<nwoob>
beach:
<phoe>
hmmm, global mutable state comes with obvious multithreading issues
<beach>
nwoob: I am sorry to hear that.
<phoe>
which chapter is that? maybe I can get some context
<nwoob>
phoe: chapter 5 page 140
<nwoob>
beach: why are you saying sorry to hear?
nwoob has left #lisp ["Killed buffer"]
nwoob has joined #lisp
<nwoob>
sorry I got disconnected
<beach>
nwoob: Because it is not generally bad to change the value of lexical variables, so if this advice is presented as a general rule, then that is very sad indeed.
<nwoob>
oh
<beach>
But I am guessing that there is some context that phoe will find.
<nwoob>
phoe: I am on chapter 5 page 140
<beach>
nwoob: Like I said, that's what "imperative programming" generally does.
<nwoob>
yes
Bike has joined #lisp
<puchacz>
people who think "imperative programming" is badder than functional invent (crazy?) languages without mutation....
<nwoob>
beach: CL has more imperative approach or functional approach?
<puchacz>
I use a lot of imperative programming
<phoe>
nwoob: neither
<phoe>
it's up to the programmer to decide.
<nwoob>
do generally programmer mix those style?
<phoe>
yes
<puchacz>
I do
<nwoob>
or is it better to stick to one?
<phoe>
why?
<phoe>
if a problem looks like a functional one, solve it with functional tools
<phoe>
if a problem looks like an object-oriented one, solve it with OO tools
<phoe>
if your problem is a mixture of those two problems, then use those as appropriate
<phoe>
I see the reasoning there; it seems to prefer the single-assignment approach in general
<phoe>
but then again, this makes e.g. iteration very hard to perform.
<nwoob>
I think, I have a long way to go before I know what approach is better for this problem
jibanes has quit [Ping timeout: 256 seconds]
matryoshka has joined #lisp
jibanes has joined #lisp
kenran has joined #lisp
aartaka has quit [Read error: Connection reset by peer]
aartaka_d has joined #lisp
imode has joined #lisp
akrl has quit [Read error: Connection reset by peer]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
akrl has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
entre-parenteses has joined #lisp
jibanes has quit [Ping timeout: 260 seconds]
<kenran>
What would be the best way to call low-level functions from glibc using SBCL? I found sb-posix, but it doesn't seem to have the calls I need (select, posix_openpt, ...).
<kenran>
I also stumbled over CFFI, is that the way to go?
<phoe>
CFFI
jibanes has joined #lisp
akrl has quit [Ping timeout: 260 seconds]
akrl has joined #lisp
<phadthai>
there was an equivalent of select in the sb sockets or such lib also
nwoob has quit [Quit: Lost terminal]
orivej has quit [Ping timeout: 246 seconds]
nwoob has joined #lisp
aartaka has joined #lisp
<phadthai>
ah it was iolib I think
aartaka_d has quit [Ping timeout: 260 seconds]
jibanes has quit [Ping timeout: 246 seconds]
jibanes has joined #lisp
thmprover has joined #lisp
_jrjsmrtn has joined #lisp
akrl has quit [Read error: Connection reset by peer]
akrl has joined #lisp
__jrjsmrtn__ has quit [Ping timeout: 260 seconds]
hiroaki has quit [Ping timeout: 264 seconds]
skapate has joined #lisp
skapata has quit [Ping timeout: 272 seconds]
entre-parenteses has quit [Quit: ERC (IRC client for Emacs 27.1)]
entre-parenteses has joined #lisp
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
<jackdaniel>
iolib are cffi bindings
puchacz has quit [Remote host closed the connection]
<jackdaniel>
while serve-event is built on top of select (at least on unix)
<jackdaniel>
serve-event extension is also available in ecl contribs (a different implementation of the same [or then-the-same] protocol)
<jackdaniel>
iolib relies on libfixposix, so remember to install it first (libfixposix unifies some differences across different posix implementations)
<jackdaniel>
kenran: ^
jonatack has joined #lisp
jonatack has quit [Ping timeout: 240 seconds]
jonatack has joined #lisp
jonatack has quit [Ping timeout: 256 seconds]
jonatack has joined #lisp
zaquest has joined #lisp
zaquest has quit [Remote host closed the connection]
jibanes has quit [Ping timeout: 240 seconds]
jonatack has quit [Ping timeout: 256 seconds]
jonatack has joined #lisp
jibanes has joined #lisp
random-nick has quit [Ping timeout: 256 seconds]
Oladon has joined #lisp
lotuseat` is now known as lotuseater
EvW has joined #lisp
nij has joined #lisp
leo_song has quit [Quit: ZNC 1.7.2+deb3 - https://znc.in]
nij has left #lisp [#lisp]
leo_song has joined #lisp
liberliver has joined #lisp
<kenran>
jackdaniel: thanks! I first have to figure out how to actually work with a common lisp project :D but I've gotten cffi to work at least, so the rest will probably be similar.
<kenran>
I'm trying to write a simple terminal emulator for educational purposes, so I'll need some low-level POSIX calls.
Jeanne-Kamikaze has joined #lisp
andreyorst has quit [Ping timeout: 260 seconds]
<jackdaniel>
good luck, if you blog aboit it please let us know
<jackdaniel>
about*
<aeth>
autowrapping can be done with autowrap [1] or claw [2] or you can do manual wrapping with CFFI, which is usually faster (especially faster than autowrap, which adds runtime indirection on the pointers that the fork, claw, removes because it's supposed to enable finalizers, which are... well, hard to get right), but obviously takes more time to write. [1] https://github.com/rpav/cl-autowrap/ [2] https://github.com/borodust/claw
defdom0 has joined #lisp
gzj has joined #lisp
<aeth>
Generally, manually wrapped stuff has two layers: a direct low-level wrapping, and an attempt to make it a bit more idiomatic. e.g. cl-opengl has a %gl package (where %foo means low level or internal, like Python's _foo). The high level one will probably do conversions and wrap the errors. Doing the conversions each time is less efficient than doing it manually, though.
<aeth>
If a C API uses arrays, you might have to use a library like static-vectors. It's better than the alternatives I know of because it creates "bilingual" arrays. The catch is that you have to free them. https://github.com/sionescu/static-vectors/
orivej has joined #lisp
gzj has quit [Ping timeout: 264 seconds]
<aeth>
In general, the issue with interfacing with C stuff is having to remember to free them. This generally means something like this, except sometimes the LET binding actually creates it, too, instead of just binding it: (defmacro with-foo ((foo) &body body) (let ((gensym (gensym))) `(let ((,gensym ,foo)) (unwind-protect (progn ,@body) (free-foo ,gensym)))))
<phoe>
you could take a look at https://github.com/phoe/cl-lzma/blob/master/cl-lzma.lisp - I wrote this code some time ago and I think that it shows the basics of how to use static-vectors, as well as CFFI (with little bits of cl-autowrap)
slyrus has joined #lisp
Fare has joined #lisp
<_death>
static-vectors uses remf on &rest lists :/
srandon111 has joined #lisp
<aeth>
static-vectors has various issues. For instance, it seems to destroy type inference in SBCL, so you're forced to declare for efficient code if you use it in the same function where you create it (although I usually pass them in and thus have to use declarations anyway). I think it has a mistake in its inlining or something.
mingus has joined #lisp
<aeth>
someone definitely needs to go through its source
defdom0 has quit [Quit: defdom0]
defdom0 has joined #lisp
<phoe>
_death: gasp
<phoe>
file an issue!
defdom0 has quit [Client Quit]
<_death>
I don't file issues.. maybe pull requests
puchacz has joined #lisp
<puchacz>
phoe, about abcl and postmodern - I think ABCL handles unicode ok, I was even checking length of a string that is not from basic multilingual plane, and it answered correctly (unlike Java).
<phoe>
huh. Completely no idea then.
<phoe>
Oh! WRITE-BYTE!
<phoe>
Yes, WRITE-BYTE on a stream of (unsigned-byte 8)s requires to receive an (unsigned-byte 8).
<phoe>
This means that you need to convert this character into multiple bytes. Perhaps via babel.
cosimone has joined #lisp
<puchacz>
I will check how it works for other implementations
<puchacz>
I just checked now on ABCL 1.7.1 an ancient egiptian hieroglyph, and it works correctly
<puchacz>
ABCL is right, I agree, Java would have said 2 (wrong)
<puchacz>
Java has hardwired concept of character being 16 bits exactly, which is not correct for many unicode characters, in this example Java would have been wrong, ABCL is right
<puchacz>
I am not sure how to check type details of TWO-WAY-STREAM....
<puchacz>
sly is saying
<puchacz>
#<SYSTEM::SOCKET-STREAM {3F289259}>--------------------The object is of type SOCKET-STREAM.class: #<STRUCTURE-CLASS TWO-WAY-STREAM {10FF64C2}>
<phoe>
hmmmmmmm...
<puchacz>
describe is saying the same
<phoe>
I don't know how to debug that one at the moment
<puchacz>
no problem :)
<borodust>
avoid :claw for autowrapping - that's a secret tool
<puchacz>
I have just been playing with ABCL
marcoxa has quit [Ping timeout: 256 seconds]
<Xach>
a Forbidden Tool!
<borodust>
YES
entre-parenteses has quit [Ping timeout: 260 seconds]
entre-parenteses has quit [Ping timeout: 260 seconds]
<Xach>
hey, i recognize that channel
<ck_>
Xach: it's pretty good you should check it out
thmprover has quit [Quit: This parting was well made]
the-smug-one has joined #lisp
jw4 has quit [Read error: Connection reset by peer]
jw4 has joined #lisp
rogersm has quit []
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #lisp
mingus has quit [Ping timeout: 260 seconds]
surabax has quit [Quit: Leaving]
oxum_ has quit [Remote host closed the connection]
<borodust>
aeth: true, but :claw is being slightly completely revamped to include C++ support (literally, no cl-autowrap code left there, no c2ffi too) and it's dangerous to use it
oxum has joined #lisp
<borodust>
API won't change much, but still gonna transform a bit to incorporate some C++ stuff
jeosol has joined #lisp
aeth has quit [Ping timeout: 240 seconds]
<borodust>
that's what happens if you try to run :claw xD
oxum has quit [Ping timeout: 256 seconds]
<kenran>
what in cffi do I use to access C constants like O_RDWR? how do I reference them?
aeth has joined #lisp
akoana has joined #lisp
<phoe>
you usually redefine them in CL because they are not a part of C
<phoe>
they're a part of the C preprocessor
<phoe>
so there is nothing to refer to once the code is preprocessed or compiled.
<kenran>
does that mean I'd just find out what value they have by looking at the C code then writa definition
<phoe>
yes; I don't know if the CFFI groveller is capable of auto-defining those. probably it is, I just never used it.
<phoe>
but a lot of people just redefine all the constants in Lisp code.
<no-defun-allowed>
I think you can. Let me check...
<phoe>
what are the origins of the name "groveller", anyway? is it used outside Lisp as well?
<phoe>
s/ll/l/
EvW has quit [Ping timeout: 258 seconds]
entre-parenteses has joined #lisp
<no-defun-allowed>
grovel, verb: to humble oneself or act in an abject manner, as in great fear or utter servility.
<phoe>
yes, I understand the meaning, but how does it refer to parsing C code?
jeosol has quit [Ping timeout: 245 seconds]
<no-defun-allowed>
One must imagine the groveller happy.
<phoe>
...
<phoe>
This answer is both satisfying and unsatisfying
<phoe>
I guess this is enough for now
skapate has quit [Quit: Leaving]
<ane>
is there any scenario where doing (defvar *x*) (setf (documentation '*x* 'variable) "foo") is more appropriate than (defvar *x* nil "Foo") ?
<ane>
i.e. using setf documentation over defvar
<no-defun-allowed>
In the first example, *X* will be unbound. In the second, it will be bound to NIL. These are different.
<phoe>
yes, when you want the symbol to remain unbound
<kenran>
phoe: no-defun-allowed: thanks!
<the-smug-one>
Also when you want to separate your docstrings from your variable declaration
<phoe>
evaluating *x* in the first case will signal an error; evaluating *x* in the second case will return NIL.
<ane>
right, ok
jibanes has quit [Ping timeout: 264 seconds]
jibanes has joined #lisp
shka_ has quit [Ping timeout: 272 seconds]
badcfe has joined #lisp
jeosol has joined #lisp
jibanes has quit [Ping timeout: 265 seconds]
jibanes has joined #lisp
the-smug-one has quit [Remote host closed the connection]
nij has joined #lisp
GuerrillaMonkey has joined #lisp
nwoob has quit [Ping timeout: 265 seconds]
<Xach>
phoe: i don't know the original intent, but i have thought of "groveling around" as something a creater might do to search for something. and interpreted it in lisp to mean to look through the C system for things.
<Xach>
creater? creature.
Jeanne-Kamikaze has quit [Ping timeout: 265 seconds]
<Xach>
"grovel" being roughly "search"
<Nilby>
I think it's called the groveler because it's humiliating for Lisp to have to beg C code for something. I refuse to have my code grovel at the feet of some C preprocessor macros.
<Nilby>
It's also that double meaning and perhaps a bit of acknowledgment of the indignity.
<phoe>
I can dig this explanation
<badcfe>
are? the value of the expression 0 the same as of the expression '0
<phoe>
badcfe: yes, because '0 evaluates to 0 and 0 evaluates to 0
<badcfe>
phoe: thanks!
scymtym has quit [Remote host closed the connection]
<phoe>
badcfe: do you know how quoting works?
<phoe>
this trick only works because 0 is a so-called self-evaluating object
<phoe>
doing this trick with x and 'x won't work!
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #lisp
EvW has joined #lisp
GuerrillaMonkey has quit [Ping timeout: 256 seconds]
<badcfe>
phoe: i think the quote is to not evaluate. but if you evaluate a literal integer, then the result is exactly itself, the very same thing, is that correct?
<phoe>
yes
<phoe>
this doesn't work with lists and this doesn't work with symbols, because they don't self-evaluate in the general case
<badcfe>
a list would evaluate to i.e a function form, right? unless first symbol is special or a macro.
<badcfe>
s/a function form/function application/
<phoe>
yes
<phoe>
and symbols generally evaluate to their values in the current environment.
<phoe>
unless they're constants, at which point the above still holds
<phoe>
unless they're symbol macros, at which point the above doesn't really hold - the symbol macro is expanded in place and that gets evaluated again.
harlchen has quit [Quit: WeeChat 2.9]
scymtym has joined #lisp
nij has quit [Remote host closed the connection]
nij has joined #lisp
amb007 has quit [Read error: Connection reset by peer]
nij has quit [Quit: ERC (IRC client for Emacs 27.1)]
amb007 has joined #lisp
cosimone has quit [Quit: cosimone]
kenran has quit [Quit: leaving]
jibanes has quit [Ping timeout: 260 seconds]
jibanes has joined #lisp
gaqwas has quit [Ping timeout: 264 seconds]
flazh has quit [Ping timeout: 246 seconds]
flazh has joined #lisp
hineios has joined #lisp
thecoffemaker has quit [Ping timeout: 240 seconds]
galex-713 has quit [Ping timeout: 260 seconds]
jibanes has quit [Ping timeout: 260 seconds]
Oladon has quit [Quit: Leaving.]
EvW has quit [Ping timeout: 260 seconds]
jibanes has joined #lisp
cosimone has joined #lisp
random-nick has quit [Ping timeout: 256 seconds]
thecoffemaker has joined #lisp
villanella has quit [Ping timeout: 258 seconds]
jibanes has quit [Ping timeout: 260 seconds]
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #lisp
dtb has joined #lisp
jibanes has joined #lisp
aartaka has quit [Ping timeout: 240 seconds]
EvW has joined #lisp
ksixty has joined #lisp
jibanes has quit [Ping timeout: 264 seconds]
cosimone has quit [Quit: cosimone]
jibanes has joined #lisp
joast has quit [Quit: Leaving.]
joast has joined #lisp
rumbler31 has quit [Remote host closed the connection]
thmprover has joined #lisp
galex-713 has joined #lisp
<thmprover>
Is there some way to determine how many bits the significand has for a double?
jibanes has quit [Ping timeout: 256 seconds]
jibanes has joined #lisp
<Alfr_>
thmprover, (float-precision 1d0)
<thmprover>
Awesome, thanks :)
<Alfr_>
thmprover, I don't think there are other implementations, but you should also check that float-radix is 2. The standard allows for other bases.