morganw has quit [Remote host closed the connection]
igemnace has joined #commonlisp
iamFIREc1 has joined #commonlisp
iamFIREcracker has quit [Ping timeout: 256 seconds]
kevingal has quit [Remote host closed the connection]
attila_lendvai has quit [Ping timeout: 250 seconds]
taiju` has joined #commonlisp
karlosz has joined #commonlisp
Devon has joined #commonlisp
iamFIREcracker has joined #commonlisp
iamFIREc1 has quit [Ping timeout: 256 seconds]
karlosz has quit [Quit: karlosz]
asen has joined #commonlisp
random-nick has quit [Ping timeout: 256 seconds]
ec has quit [Quit: ec]
kingofcsu has joined #commonlisp
anticomputer_ has joined #commonlisp
anticomputer has quit [Ping timeout: 240 seconds]
cjb has quit [Ping timeout: 260 seconds]
kingofcsu has quit [Quit: kingofcsu]
Oladon has joined #commonlisp
thomaslewis has joined #commonlisp
Bike has quit [Quit: Lost terminal]
<s-liao>
How can I came back to see the signature of the procedure, which have been defined in REPL?
etimmons has quit [Remote host closed the connection]
<White_Flame>
(describe #'foo) will give the lambda list & return type, if that's what you mean by "signature"
<White_Flame>
(at least in sbcl)
etimmons has joined #commonlisp
<s-liao>
Yes. that is what I wanted.
<s-liao>
But that all characters became the uppercase characters
<White_Flame>
they are symbols, not strings
<White_Flame>
symbols are converted to (by default) uppercase right when the symbol is read from text
<aeth>
If you don't like the SHOUTING, you can run this in your REPL first... (setf *print-case* :downcase)
<aeth>
However, it's not perfect because not every symbol is upper cased and there is no way to *print-case* in a way that disambiguates between 'foo and '|foo| the latter of which will actually keep the lower case
<White_Flame>
although then you won't be able to work with some code out there which makes an assumption about symbol case
<aeth>
(I mean, no way other than the default value)
<s-liao>
That is Okay.
<s-liao>
But mostly I would like access the document of these things.
<White_Flame>
it's really better form to have your DEFUNs in a .lisp file, and then you can cross-reference it directly with M-. etc
jealousmonk has quit [Ping timeout: 250 seconds]
<s-liao>
Okay. it is like Elisp self-description
<s-liao>
Thanks
waleee has quit [Ping timeout: 252 seconds]
<Guest7480>
any thoughts on storing dates parsed from binary files, like creation dates. Encode into universal time or some human readable string?
jealousmonk has joined #commonlisp
<pillton>
I have no advice but I doubt universal time would be useful since it is defined only for dates from January 1 1900 GMT.
<pillton>
I imagine looking at how databases store time and dates would be a good place to start. SQLite mentions ISO-8601.
<Guest7480>
well, I didn't mean creation dates like that of earth :)
<pillton>
There is also the local-time library.
Oladon has quit [Quit: Leaving.]
<Guest7480>
but I guess you're saying human readable.
<drakonis>
have ELS's approved talks been published yet?
<beach>
I don't think so. Authors were informed only yesterday.
semz_ has joined #commonlisp
semz has quit [Ping timeout: 260 seconds]
s-liao has quit [Quit: Client closed]
jealousmonk has quit [Quit: ERC 5.4.1 (IRC client for GNU Emacs 27.1)]
<mfiano>
I have a question about Emacs/SLIME. Is it okay to ask here?
<pillton>
Sure.
<mfiano>
Is there anything like C-x C-e (slime-eval-last-expression), that, instead of printing the return value in the minibuffer, will insert it into the buffer at point?
<mfiano>
I ask because I am copying "BigFloat" constants into Common Lisp code from another language, and I want to round it to what my implementation READs it as, removing useless fractional digits.
<mfiano>
My workflow has been to C-x C-e it, then manually remove digits/round and append "d0"
<mfiano>
It's quite tedious
<mfiano>
or well, I append the "d0" first before eval'ing I mean.
Oladon has quit [Quit: Leaving.]
<edgar-rft>
mfiano: C-u C-x C-e inserts the result at the cursor position if that's what you want
<beach>
Try it with a numeric argument.
<mfiano>
Oh thank you. Now if only there was a way to automate replacing what I evaluated with the result, instead of appending a comment at the end of line
<mfiano>
This is part of a DSL, so I think I'll just SETF *read-default-float-format* and print case in my REPL, and type out the long data format and copy the result back to code
<mfiano>
I've been doing it the hard way for days.
<mfiano>
Time to change :)
Limits has joined #commonlisp
mfiano has quit [Ping timeout: 240 seconds]
mfiano has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
SR-71 has joined #commonlisp
akoana has quit [Quit: leaving]
<pillton>
You could also make an interactive command which is a variant of (slime-eval-print (buffer-subtring-no-properties (region-beginning) (region-end))). This will evaluate the current Emacs region and write the result in the buffer.
wacki has joined #commonlisp
karlosz has joined #commonlisp
amb007 has joined #commonlisp
amb007 has quit [Read error: Connection reset by peer]
amb007 has joined #commonlisp
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
karlosz has quit [Quit: karlosz]
mayuresh has joined #commonlisp
rogersm has quit [Ping timeout: 256 seconds]
<mayuresh>
hello everyone. :)
<Josh_2>
Good Morning
shka has joined #commonlisp
mayuresh has quit [Quit: Leaving]
sander has quit [Ping timeout: 240 seconds]
trannus_aran has joined #commonlisp
silasfox has joined #commonlisp
s-liao has joined #commonlisp
cosimone has joined #commonlisp
s-liao has quit [Quit: Client closed]
rogersm has joined #commonlisp
MajorBiscuit has joined #commonlisp
lisp123 has joined #commonlisp
pve has joined #commonlisp
hashfunc461 has joined #commonlisp
s-liao has joined #commonlisp
unixlisp has joined #commonlisp
Limits has quit [Ping timeout: 240 seconds]
Limits has joined #commonlisp
s-liao has quit [Ping timeout: 256 seconds]
s-liao has joined #commonlisp
<hashfunc461>
what's wrong with my macro? i can't figure it out for the life of me. here's the code along with the macro-expanded output (in the comments) https://pastebin.com/rXtX5973
<moon-child>
I expect you want (eq language 'html), not `(eq ',language 'html) (and the analogous change for the other conditions)
<beach>
hashfunc461: You need to fix your indentation if you want people to read your code.
s-liao has quit [Quit: Client closed]
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
treflip has joined #commonlisp
mgl has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
Guest7480 has quit [Ping timeout: 256 seconds]
prov[m] has quit [Quit: You have been kicked for being idle]
trannus_aran has quit [Quit: Client closed]
Dynom has joined #commonlisp
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
pranavats has left #commonlisp [Error from remote client]
Limits has quit [Ping timeout: 240 seconds]
<hashfunc461>
moon-child: that worked! now to figure out what my wrong assumptions were/are
<hashfunc461>
so nested-backticked-forms get evaluated first. ok that makes sense
attila_lendvai has joined #commonlisp
<hashfunc461>
now if there's a comma within a backticked form, then arguments within the comma'd form need not be commad
scymtym has quit [Ping timeout: 240 seconds]
Brucio-61 has quit [Ping timeout: 240 seconds]
<hashfunc461>
i guess what I don't understand is why ... language ... doesn't have to be evaluated, but ... ,@body ... does
<beach>
It looks to me like the conditional in the COND form is a non-empty list, so it is always true.
<beach>
... but it is hard to follow your code because it is incorrectly indented.
<hashfunc461>
beach: i used the default emacs indenting. not sure what i need to correct there
<beach>
Your code probably has TABs in it then.
<hashfunc461>
beach: ah yup it does. just checked
<beach>
You need to instruct Emacs not to use TABs for indentation. Paste sites don't handle TABs very well.
<beach>
If you already have TABs in your code, you can use the emacs command UNTABIFY.
<hashfunc461>
my only question is why the form with ... ,@body ... has to be backticked, but ... language ... doesn't
<moon-child>
beach: it renders correctly for me. Perhaps your browser is not rendering tabs correctly? Try setting tab-size:8
<beach>
I see.
<moon-child>
hashfunc461: it may be less confusing to try to write the macro without using quasiquotation at all
<beach>
hashfunc461: So try this out in your REPL: (cond ((eq *package* *standard-output*) "yes") (t "no")) vs (cond (`(eq ,*package* ,*standard-output*) "yes") (t "no")).
<moon-child>
hashfunc461: recall that a macro is effectively a function, which takes a list of forms (which are not evaluated) and returns a form (which is then evaluated)
<hashfunc461>
moon-child: is that standard practice? to not "aim" for the desired form, but "aim" for the desired execution? if that makes sense
<moon-child>
hashfunc461: I would write that macro using quasiquotation. However I think it may be instructive for you to try to write it without quasiquotation
<hashfunc461>
beach: ran them both and now my mind is bent haha
<hashfunc461>
moon-child: ok, i see. i'll try it out
<hashfunc461>
beach: i don't understand how the former form evaluates to the first cond
semz_ is now known as semz
taiju` has quit [Ping timeout: 240 seconds]
kevingal has joined #commonlisp
<hashfunc461>
moon-child: alright i gotta sleep on that problem
<hashfunc461>
moon-child: beach: thanks ya'll
lisp123 has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
s-liao has joined #commonlisp
hashfunc461 has quit [Ping timeout: 272 seconds]
m5zs7k has quit [Ping timeout: 272 seconds]
lisp123 has joined #commonlisp
m5zs7k has joined #commonlisp
lisp123 has quit [Remote host closed the connection]
azimut has quit [Remote host closed the connection]
azimut has joined #commonlisp
notzmv has joined #commonlisp
pillton has quit [Quit: ERC (IRC client for Emacs 27.2)]
unixlisp has quit [Remote host closed the connection]
nature has quit [Ping timeout: 272 seconds]
s-liao has quit [Ping timeout: 256 seconds]
blacked has joined #commonlisp
<blacked>
:)
random-nick has joined #commonlisp
eugercek has quit [Remote host closed the connection]
eugercek has joined #commonlisp
eugercek has quit [Remote host closed the connection]
nature has joined #commonlisp
<Demosthenex>
so i hit heap limit and then another memory error which dumped me into little debugger breaking sky on some rather small and simple code. is there something i can have report on what's happening to help identify the problem?
<jackdaniel>
and what is the implementation that you use?
<Demosthenex>
i'm basically using run-program and a function to step thru the output stream (ie: cmd | grep, nothing complex), and i was deliberately reading the stream instead of dumping into a list of strings to save ram
<Demosthenex>
oh, sbcl.
<jackdaniel>
also please link this simple program
<Demosthenex>
i'm having a hard time reproducing it, that's why i'm asking about instrumentation.
<jackdaniel>
I'm sure that there are some folks who /can/ use the low level debugger in sbcl but I'm not one of them - usually it is a game over :)
<phoe>
"rather small and simple code", you say
<jackdaniel>
the other day we had this discussion whether the implementation should provide a soft limit for the heap so it can comfortably report the condition
<Demosthenex>
sbcl over sly didn't output any warnings as the memory got critical, i had to truss the process to discover it aborted into debugger
<jackdaniel>
instead of putting you in an awful situation where you hit the game over
<Demosthenex>
game over is fine, if sly hadn't been obtuse too ;]
<Demosthenex>
i've tried increasing --dynamic-size, and 1 in 30 is still triggering this
<jackdaniel>
btw, do you use sb-ext:run-program or uiop:run-program ?
<Demosthenex>
at this point i either have to add logging at many levels, or just get sbcl to warn me or something
<Demosthenex>
uiop
<jackdaniel>
the latter is awful because it puts itself between the process and the stream
<Demosthenex>
oh? maybe that's a quick fix
<Demosthenex>
i'm literally doing the cl equiv of grepping the output of a tar command :P
<jackdaniel>
so that may be the reason - you think that you don't read everything into the memory, but uiop possibly does the "slurping" thing where it first reads everything and then allows you to read from its memory-allocated stream
<Demosthenex>
odd. i specify a function so that slurp lets me read the stream. i'll go swap and try the sbcl one
Guest74 has joined #commonlisp
tyson2 has joined #commonlisp
<Demosthenex>
honestly, i tried using cl-tar and chipz to try and read the compressed tar, but the perf was so bad i reverted to using the tar command
<flip214>
Demosthenex: can't reproduce, neither with small nor big buffers
<Demosthenex>
flip214: like i said, it just crashes down around my ears on one input. my question was about instrumentation for memory, assuming it's my error that more is used than needed.
<etimmons>
Demosthenex: uiop:run-program will slurp the entire output. You probably want uiop:launch-program
minion has quit [Ping timeout: 240 seconds]
s-liao has joined #commonlisp
<_death>
Demosthenex: if the probability of failure is 1/30 and independent of other runs, then you can run it 138 times to get 99% chance of reproduction
specbot has quit [Ping timeout: 256 seconds]
<Demosthenex>
etimmons: yeah, i'm looking at sb-ext, i'll read that one too
<Demosthenex>
_death: its a consistent failure on the same file, the irony is it's a small one. again i assume i made an error, but because it all just crashes i dont even know where to look adding extensive logging
<Demosthenex>
a memory warning would be nice
yewscion has joined #commonlisp
blacked has quit [Quit: blacked]
specbot has joined #commonlisp
minion has joined #commonlisp
<_death>
sbcl has an allocation profiler, maybe it can be helpful
lisp123 has joined #commonlisp
<Demosthenex>
yep, it's gotta be my code, sb-ext:run-program produces the same crash on that file
<Demosthenex>
well, guess i'll have to add log4 statements everywhere.
Bike has joined #commonlisp
s-liao has quit [Quit: Client closed]
<etimmons>
Did you set :wait nil? If not, it's slurping the entire stream as well (I think)
<Guest74>
why not paste the code?
unixlisp has joined #commonlisp
<Demosthenex>
etimmons: yep, i did some manual tests. i'm reading the stream using process-output and run-program :wait nil :output :stream
s-liao has joined #commonlisp
<Demosthenex>
Guest74: maybe because it doesn't work without a large tarball? or maybe i'm asking how to debug it crashing due to OOM with no warning or outputs? clearly it's my fault and i don't have a short MWE. but i also have no clue where it's dying because there's nothing to go on
unixlisp has quit [Remote host closed the connection]
unixlisp has joined #commonlisp
<Demosthenex>
hrm. "no more immobile pages" that's new
<etimmons>
Well that's unfortunate. At this point I'd probably try to remember how to use SBCL's allocation profiler
unixlisp has quit [Remote host closed the connection]
<Demosthenex>
i found a thing on SO and wrapped my call in an sb-sprof call, even with :show-progress it output nothing, just bombed
blacked has joined #commonlisp
[w] has joined #commonlisp
yewscion has quit [Ping timeout: 256 seconds]
<Demosthenex>
i think i found it, i had an unlimited area where i was interning keywords, not that sbcl gave me any clues :P
s-liao has quit [Quit: Client closed]
Devon has quit [Ping timeout: 240 seconds]
<etimmons>
Demosthenex: Yeah, I don't think any of the Free CL implementations handle running out of memory very well.
mgl has quit [Quit: Client closed]
<etimmons>
Also, I suspect most of the cl-tar slowness you were seeing is coming from chipz. If you were reading from an uncompressed tar file and it was still unacceptably slow I'd love to know about it.
<jackdaniel>
ecl preallocates some memory at startup so during the storage-condition reasonable allocations may still be performed
<Demosthenex>
etimmons: i used run-program to use tar -zxOf and dump the file i wanted to stdout :P
<jackdaniel>
(i.e to handle invoke a restart, run a gc or some other recovery tasks)
<Demosthenex>
etimmons: i did some testing of diff compressions (uncomp, bz2, xz) and xz was pretty quick, but still 15 sec vs 0
<Demosthenex>
and i just found it wasn't my interning, i thought i wasn't being careful but i had the proper filter :P
<etimmons>
jackdaniel: that's good to know!
frgo has joined #commonlisp
Common-Lisp has joined #commonlisp
lisp123 has quit [Ping timeout: 240 seconds]
attila_lendvai has quit [Ping timeout: 256 seconds]
pranavats has joined #commonlisp
_73 has joined #commonlisp
VincentVega has joined #commonlisp
waleee has joined #commonlisp
Common-Lisp has quit [Ping timeout: 256 seconds]
silasfox has quit [Quit: WeeChat 3.4]
sloanr has joined #commonlisp
robin has quit [Quit: Leaving]
robin_ has joined #commonlisp
robin_ is now known as robin
IPmonger has joined #commonlisp
IPmonger has quit [Remote host closed the connection]
jealousmonk has joined #commonlisp
waleee has quit [Ping timeout: 240 seconds]
edgar-rft has quit [Quit: Leaving]
hobo has joined #commonlisp
jeosol has quit [Quit: Client closed]
hobo has quit [Read error: Connection reset by peer]
hobo has joined #commonlisp
hobo has quit [Client Quit]
tyson2 has quit [Remote host closed the connection]
hobo has joined #commonlisp
eugercek has joined #commonlisp
blacked has quit [Quit: Client closed]
blacked has joined #commonlisp
blacked has quit [Client Quit]
mgl has joined #commonlisp
blacked has joined #commonlisp
hobo has quit [Read error: Connection reset by peer]
hobo has joined #commonlisp
SR-71 has quit [Remote host closed the connection]
blacked has quit [Quit: Client closed]
ec has joined #commonlisp
sloanr has quit [Ping timeout: 256 seconds]
jeosol has joined #commonlisp
edgar-rft has joined #commonlisp
MajorBiscuit has quit [Ping timeout: 240 seconds]
<_73>
is it possible to make FORMAT print NIL as an empty string with the ~A directive? (format nil "~{~:A~^ ~}" '("foo" 12 nil)) ;;=> "foo 12 ()" ... but instead I want ;;=> "foo 12"
<Bike>
i think avoiding an extra space at the end might be sort of a pain in the ass, though
attila_lendvai has joined #commonlisp
<_73>
yes I can't have the trailing space. I was thinking this may be a problem with a common solution but it may be better to just preprocess.
<jcowan>
Or postprocess, returning the substring up to but not including the last character.
<Bike>
yeah, string-right-trim is easy
<White_Flame>
only if the NIL only ever appears at the end
<White_Flame>
if it's in the middle, you'll have to s/ / /g
<White_Flame>
then trim both ends
<Bike>
you can just do ~@[~a~^ ~] to take care of the middle ones, i think
tyson2 has joined #commonlisp
Oladon has joined #commonlisp
karlosz has joined #commonlisp
karlosz has quit [Client Quit]
treflip has quit [Quit: good nigh!]
lisp123 has joined #commonlisp
lisp123 has quit [Client Quit]
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
ldb has joined #commonlisp
<jcowan>
I thought this was trying to solve the problem of putting spaces between strings but not before or after: it should be somewhat more efficient to chop the last character than the first.
masinter has joined #commonlisp
<qhong>
Is there a reliable macroexpand-all on SBCL? sb-cltl2:macroexpand-all doesn't handle declaration information in environment correctly
<qhong>
That's to say, sb-cltl2:macroexpand-all doesn't produce identical result as what real eval does
Guest74 has quit [Quit: Connection closed]
parjanya has quit [Ping timeout: 240 seconds]
ldb has quit [Quit: ERC (IRC client for Emacs 27.2)]
euandreh has quit [Ping timeout: 240 seconds]
euandreh has joined #commonlisp
<phoe>
qhong: could you link a reproducible test case?
<qhong>
I do use sb-c::stuff so maybe myself is to be blamed
patrice has joined #commonlisp
Volt_ has joined #commonlisp
<flip214>
qhong: how about the macroexpander from swank?
<qhong>
phoe: btw, it is reproducible without using sb-c::stuff. The declaration list returned by sb-cltl2:variable-information as the third return value, is also different from sb-cltl2:macroexpand-all and real eval
<qhong>
flip214: I'm using sly and the interactive expander is as wrong as sb-cltl2. I suspect it uses sb-cltl2 under the hood anyway
tane has joined #commonlisp
Oladon has quit [Quit: Leaving.]
<qhong>
hmm, I digged into SBCL's compile a bit, and it seems that real eval/compile don't have a distinct macro expansion phase, rather it is interleaved when doing ir1-tran? I might be wrong
Odin- has quit [Ping timeout: 240 seconds]
v88m has joined #commonlisp
Lord_of_Life_ has joined #commonlisp
Lord_of_Life has quit [Ping timeout: 256 seconds]
Lord_of_Life_ is now known as Lord_of_Life
v88m has quit [Quit: Quit]
v88m has joined #commonlisp
karlosz has joined #commonlisp
<dbotton>
what does this produce extra spaces around the return of function X which is ":memory:" - `(\",(x)\") => (|"| ":memory:" |"|)
karlosz has quit [Quit: karlosz]
<semz>
dbotton: It's returning a list. \" is the symbol |"| whose name is a doublequote.
<semz>
What are you expecting it to return?
<dbotton>
I think I was expecting it to be interpreted as one symbol not three
<dbotton>
\" as 1 ,(x) as 2 and \" as 3rd
<Xach>
backquote and comma are not the tools to construct symbols
<random-nick>
why are you making a symbol with double quotes in the first place?
<dbotton>
I guess because worked for my purpose till now.. which was using a macro to output text
<dbotton>
I guess in retrospect I should have never thought that would work... live and learn
<White_Flame>
gensym or intern for constructing symbol names
<White_Flame>
(well, usually FORMAT for constructing the actual name, GENSYM or INTERN for instantiating the symbol)
Devon has joined #commonlisp
<dbotton>
this was to construct text
<dbotton>
it is part of my code generation for clog builder. I am building APIs to extend the builder with your own custom controls. At least I made an error I can expect from future users
wacki has quit [Quit: Leaving.]
<random-nick>
if a macro only outputs a string you might not need a quasiquote in the first place
<random-nick>
but that depends on how the API looks like
amb007 has quit [Ping timeout: 256 seconds]
amb007 has joined #commonlisp
tyson2 has quit [Remote host closed the connection]
<White_Flame>
you might not need it as a macro either :-P
cage has quit [Quit: rcirc on GNU Emacs 27.1]
mgl has quit [Ping timeout: 256 seconds]
orestarod has joined #commonlisp
morganw has joined #commonlisp
<dbotton>
it is actually not technically a macro and the quasiquote to accessed various attributes to be inserted in the code generated.