phoe changed the topic of #lisp to: Common Lisp, the #1=(programmable . #1#) programming language | <http://cliki.net/> <https://irclog.tymoon.eu/freenode/%23lisp> <https://irclog.whitequark.org/lisp> <http://ccl.clozure.com/irc-logs/lisp/> | SBCL 1.4.16, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
longshi has quit [Ping timeout: 252 seconds]
gxt has quit [Quit: WeeChat 2.4]
gxt has joined #lisp
Achylles has joined #lisp
gxt has quit [Client Quit]
gxt has joined #lisp
abarbosa has quit [Remote host closed the connection]
Kaisyu7 has quit [Quit: ERC (IRC client for Emacs 26.2)]
Achylles has quit [Ping timeout: 258 seconds]
quazimodo has joined #lisp
Kaisyu7 has joined #lisp
beach has quit [Ping timeout: 252 seconds]
rdh has quit [Quit: Leaving]
rozenglass has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
bexx has quit [Ping timeout: 272 seconds]
oni-on-ion has joined #lisp
torbo has joined #lisp
akoana has left #lisp ["Leaving"]
equwal has joined #lisp
equwal has left #lisp ["ERC (IRC client for Emacs 27.0.50)"]
equwal has joined #lisp
<equwal>
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
Lord_of_Life has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
Lord_of_Life has joined #lisp
rvirding has quit [Ping timeout: 252 seconds]
dale_ has joined #lisp
dale has quit [Disconnected by services]
dale_ is now known as dale
rvirding has joined #lisp
voidlily has quit [Ping timeout: 248 seconds]
v0|d has quit [Ping timeout: 252 seconds]
voidlily has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
<LdBeth> Hello
<edgar-rft> world!
<LdBeth> GG
<LdBeth> U missed a comma
karlosz has joined #lisp
Oladon has joined #lisp
zotan has quit [Ping timeout: 245 seconds]
FreeBirdLjj has joined #lisp
abarbosa has joined #lisp
<aeth> Missing commas are pretty annoying. You wind up trying to access a variable that doesn't exist because the macro author only tested the macro with outer variables having the same name as the macro variable.
zotan has joined #lisp
<aeth> Then you use foobar instead of foo and see the issue right away.
v0|d has joined #lisp
zotan has quit [Ping timeout: 248 seconds]
<LdBeth> Can someone explain what's "safe call" in CLHS
<LdBeth> Or give an example of "programmer code"
<Bike> clhs 3.5.1.1
<Bike> and
<Bike> clhs 1.4.2
<Bike> so like if a standard function "should signal an error" in some circumstance, if a call to it is safe an error will be signaled
karlosz has quit [Quit: karlosz]
zotan has joined #lisp
<LdBeth> Bike: thank you
Blukunfando has quit [Ping timeout: 272 seconds]
femi has quit [Ping timeout: 258 seconds]
Bike has quit [Quit: Lost terminal]
<Xach> Hmm, I thought change-class involved :default-initargs, but it doesn't seem to from my reading of the spec and experiments.
<Xach> bummer
karlosz has joined #lisp
beach has joined #lisp
karlosz has quit [Client Quit]
karlosz has joined #lisp
karlosz has quit [Remote host closed the connection]
<beach> Good morning everyone!
FreeBirdLjj has quit [Remote host closed the connection]
sz0 has quit [Quit: Connection closed for inactivity]
libertyprime has joined #lisp
pierpal has joined #lisp
<abarbosa> :D
abarbosa has quit [Remote host closed the connection]
torbo has quit [Remote host closed the connection]
dddddd has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 258 seconds]
pankajgodbole has joined #lisp
karlosz has joined #lisp
karlosz has quit [Quit: karlosz]
dale has quit [Quit: dale]
asarch has joined #lisp
<asarch> How could you return a t value from a function deliberately?
<Xach> asarch: have it be the last form evaluated in the function.
<beach> clhs return-from
<asarch> Thank you!
<asarch> Thank you very much guys! :-)
femi has joined #lisp
<beach> asarch: You rarely need to use RETURN-FROM. The usual way is what Xach told you.
<beach> asarch: If you find yourself using RETURN-FROM a lot, it might be that your programming style is not that great.
<aeth> I'm not sure if I've ever used return-from. Maybe once. It's very rare.
<no-defun-allowed> Works if you're doing something like a tree-traversing EVERY.
<beach> Occasionally, in a loop, when the final value becomes known, it can be a good solution.
<asarch> Well, that's for a GTK+ call back to do OpenGL rendering operations
<asarch> If a function need something like (foo ... (lambda (x y) ...)), how could I put (lambda ...) in a function and the pass that function to (foo ...)?
<asarch> Is it with (foo #'bar)?
<asarch> Or just (foo bar)?
<no-defun-allowed> (flet ((iterator (x) stuff-with-x)) (use #'iterator))
<aeth> beach: yes, that makes sense, I think I might have used it 2-3 times, then
aindilis has quit [Read error: Connection reset by peer]
aindilis has joined #lisp
donotturnoff has joined #lisp
donotturnoff has quit [Ping timeout: 272 seconds]
sauvin has joined #lisp
capisce has quit [Ping timeout: 245 seconds]
asarch has quit [Quit: Leaving]
notzmv has quit [Ping timeout: 258 seconds]
zooey has quit [Remote host closed the connection]
zooey has joined #lisp
jprajzne has joined #lisp
kajo has joined #lisp
notzmv has joined #lisp
JohnMS_WORK has joined #lisp
vlatkoB has joined #lisp
karlosz has joined #lisp
jackdaniel has quit [Remote host closed the connection]
jackdaniel has joined #lisp
terpri has quit [Remote host closed the connection]
terpri has joined #lisp
gko has quit [Quit: ZNC - http://znc.in]
rozenglass has joined #lisp
varjag has joined #lisp
ym555 has quit [Quit: leaving...]
libertyprime has quit [Ping timeout: 258 seconds]
python476 has joined #lisp
Necktwi has quit [Ping timeout: 258 seconds]
Necktwi has joined #lisp
karlosz has quit [Quit: karlosz]
JohnMS_WORK has quit [Read error: Connection reset by peer]
gko has joined #lisp
q9929t has joined #lisp
JohnMS_WORK has joined #lisp
q9929t has quit [Client Quit]
eschatologist has quit [Excess Flood]
eschatologist has joined #lisp
schjetne has joined #lisp
dpl has quit [Read error: Connection reset by peer]
rippa has joined #lisp
anewuser has joined #lisp
orivej has joined #lisp
JohnMS has joined #lisp
JohnMS_WORK has quit [Ping timeout: 248 seconds]
gjvc has quit [Ping timeout: 248 seconds]
elinow has joined #lisp
rozenglass has quit [Read error: Connection reset by peer]
hhdave has joined #lisp
hhdave has quit [Ping timeout: 272 seconds]
gko has quit [Quit: ZNC - http://znc.in]
hhdave has joined #lisp
gko has joined #lisp
beach has quit [Ping timeout: 258 seconds]
beach has joined #lisp
schweers has joined #lisp
gravicappa has joined #lisp
scymtym has joined #lisp
gravicappa has quit [Ping timeout: 268 seconds]
cosimone has joined #lisp
<phoe> heyyy
<no-defun-allowed> Hello phoe.
cosimone has quit [Ping timeout: 252 seconds]
cosimone has joined #lisp
schweers has quit [Remote host closed the connection]
schweers has joined #lisp
schweers has quit [Remote host closed the connection]
schweers has joined #lisp
oni-on-ion has quit [Ping timeout: 245 seconds]
python476 has quit [Remote host closed the connection]
elinow has quit [Ping timeout: 245 seconds]
heisig has joined #lisp
manualcrank has quit [Quit: WeeChat 1.9.1]
oni-on-ion has joined #lisp
manualcrank has joined #lisp
pankajgodbole has quit [Ping timeout: 272 seconds]
manualcrank has quit [Client Quit]
manualcrank has joined #lisp
Achylles has joined #lisp
jmercouris has joined #lisp
<jmercouris> is there a type of AND macro or form that instead of returning the result of evaluating the last form returns t or nil?
<jmercouris> you could of course wrap the AND in a WHEN and have t as the body of WHEN, but that seems a bit clunky
<jdz> jmercouris: Just add T at the end.
<jmercouris> ah, yes
<jmercouris> jdz: thank you
<jdz> I'm glad the proposed solution works for you.
<jackdaniel> (not (not (last-form))) is another way to normalize the value
<jackdaniel> admittedly longer
<jmercouris> I do feel like this would be a good candidate for a macro though
<jmercouris> it could be called like AND-P or something
<jmercouris> or wait ANDP
<jmercouris> the dash is only if there are other dashes
<shka_> i don't think this is a good idea
<jmercouris> why not?
<shka_> you are better off with function like not-null
<shka_> or as-boolean
rotty1 has quit [Ping timeout: 264 seconds]
<jackdaniel> question: how often do you need AND to return either NIL or T?
<shka_> and why not OR
<jdz> And using (if (and ...) t nil) might communicate your intent even better.
<shka_> i advice against the above
<shka_> anyway, i would simply add function converting to boolean and be done with it
<aeth> jackdaniel: when storing something
<jackdaniel> "you" is implicitly pointing at jmercouris as the person to whom I address the question
<jmercouris> jackhill: not very often
<jmercouris> sorry, wrong username
<jmercouris> jackdaniel: not very often
<jmercouris> I would say about 1/25th of all times I write conditionals do I want it to be explicit that it is a bool
<jackdaniel> then is it worth to extend a vocabulary with this particular verb?
<jmercouris> perhaps not, I do like the (if (and ...) t nil) suggested above, it is clear
<shka_> aeth: thing is that storing is orthogonal to logical operators. You will need to do the same with a lot of functions in multiple places, creating custom versions of each of those is pointless
<beach> jmercouris: Most of the time, the arguments to AND should be Boolean values anyway.
<beach> The only exception I can see would be when some standard Common Lisp function returns a generalized Boolean, such as DIGIT-CHAR-P.
<jmercouris> beach: well, in this case I was using a find-if basically to check if some element exists in the list, and it was returning that element instead of a Boolean
<beach> Yes, I see.
<jmercouris> this is all stemming from that email a few months ago about Booleans
<jmercouris> I have been thinking about it, and while it is more verbose instead of just leaving it as a find-if, it more clearly conveys intent
<beach> On the other hand, you should almost never see the value of the AND form.
<jmercouris> why is that? I have it as part of a predicate function
<beach> It should typically only appear in a context of a conditional.
<_death> maybe you want SOME
elinow has joined #lisp
<jmercouris> I think that would be a bit strange like (defun my-predicate-p (when (and ...)))
<beach> jmercouris: If the AND form is in an IF, COND, WHEN, UNLESS or something like that, you will never see the value.
<beach> Right, but then my-predicate should only appear in such a position, so again, you won't see it.
<jmercouris> _death: SOME and NOTANY are things I have not encountered, and do seem more clear than FIND-IF which is meant to operate on the element if it is found
<jmercouris> at least the name makes me feel like it is intended to operate on the element
<jackdaniel> code like: (let ((foo (and xyz abc (qux xyz abc))) …); is not uncommon
<jmercouris> lots to think about here...
<beach> jackdaniel: Yes, but then I expect FOO to be used in a conditional.
<jmercouris> that's the thing with software engineering and languages, it is so philosophical :D
<jackdaniel> jmercouris: difference between and /and/ every is that the latter evaluates all its arguments because it is a function
<_death> FIND-IF also won't do if the particular element is NIL
<beach> jmercouris: What I am trying to say is that the return value of AND should only ever end up in a conditional, so then the exact nature of the true value is unimportant.
<jackdaniel> in case of and arguments are evaluated until you find NIL
<jackdaniel> this is important distinction if the arguments are forms which have side-effects (or take long to process)
<jmercouris> beach: yes, I see what you are saying
<jmercouris> it does make sense, I will try writing code with that in mind for some time
<jackdaniel> (same applies to OR vs SOME)
<_death> jackdaniel: you're right but note that EVERY will also stop checking if the predicate returns false.. the difference is that AND is connective and EVERY is a (Common Lisp) predicate
<jmercouris> jackdaniel: I'm having trouble understanding what you are saying, are you talking about short circuiting?
<jackdaniel> _death: I'm talking about argument evaluation, not about predicate evaluation
<_death> jackdaniel: sure, that's why I said you're right :)
<jackdaniel> jmercouris: try this: (every #'identity (print 1) (print 2) nil (print 3)) and try this (and (print 1) (print 2) nil (print 3))
<jmercouris> jus to be clear I'm referring to: https://en.wikipedia.org/wiki/Short-circuit_evaluation
<jackdaniel> yes, this is it
<jmercouris> ok, then I understand what you are saying
<jackdaniel> _death: right
<_death> there are also LOOP keywords ALWAYS/THEREIS/NEVER by the way
<jmercouris> I feel like one needs a degree in LOOP to understand it, like a four year program or something
<jmercouris> how long did it take to come up with this macro?
<jmercouris> I can only imagine the man-hours required
<jackdaniel> it has grown from a hack to a standard
<jackdaniel> when you put enough constructs on top of a hack it becomes standard (see: "posix") ;-)
cosimone has quit [Quit: WeeChat 2.3]
jmercouris has quit [Ping timeout: 248 seconds]
crystalball has joined #lisp
<shka_> which lisp invented LOOP?
crystalball has quit [Client Quit]
<no-defun-allowed> hmm, i think CL's fancy loop is a deriative of MIT Loop
hjudt has quit [Quit: leaving]
<no-defun-allowed> sbcl's loop implementation has notices from Symbolics and the MIT AI Lab so it's possible
<no-defun-allowed> sounds like something Interlisp's CLISP would do though, it let you put meaningless words like `(if (foo-p thing) then ... else ...)` in places to make it more readable
amerlyq has joined #lisp
<jackdaniel> this may shed some light in loop history: http://www.paulgraham.com/loop.html
donotturnoff has joined #lisp
dddddd has joined #lisp
jmercouris has joined #lisp
igemnace has quit [Quit: WeeChat 2.4]
ggole has joined #lisp
JohnMS_WORK has joined #lisp
<_death> sounds like knee-jerk antiloopism
notzmv has quit [Ping timeout: 245 seconds]
<no-defun-allowed> PG does not like anything remotely deep
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
<no-defun-allowed> pretty sure him and ESR have some weird anti-CLOS thing too
JohnMS has quit [Ping timeout: 248 seconds]
<jackdaniel> I'm referring to what Dan Weinreb said
<jackdaniel> (so I recommend skipping tl;dr attitude and see what is said by one of the construct authors)
<no-defun-allowed> i did read it, must have missed the obvious introduction that pointed out that PG didn't write that
<_death> no-defun-allowed: well, I sympathise with both camps :).. I think it's good to be skeptical of both loop/antiloop and clos/anticlos :)
<no-defun-allowed> (though "I consider Loop one of the worst flaws in CL, and an example to be borne in mind by both macro writers and language designers." in the parens suggests i'm not wrong, just completely off the point)
<_death> or should I say clos/clostrophobia
<no-defun-allowed> amazing
crystalball has joined #lisp
crystalball has quit [Client Quit]
<jmercouris> I can understand antiloop, I can't sympathize with anticlos
<_death> consider the premise that object-oriented style is just one possible paradigm out of many
scymtym has quit [Ping timeout: 248 seconds]
<_death> jumping straight to clos, or delving deep into the mop to make it suitable to your problem may not be the most efficient or clear approach to get at what you actually want
<_death> of course, sometimes what you actually want brings you to clos/mop, and that's great
* didi has "The art of the metaobject protocol" queued to be read
<jmercouris> that's the thing though, should we remove procedural style from Lisp?
terpri has quit [Ping timeout: 246 seconds]
<jmercouris> it is also one of many paradigms
<jmercouris> granted, you cannot make the argument that it required any changes to Lisp to implement
<jmercouris> I'm not sure where I'm going with this, but I cannot imagine Lisp without introspection and CLOS
<jackdaniel> anti-clos as in: "do not use clos", not "remove clos from the language"
<jmercouris> what do they suggest instead? structs and functions only?
<jmercouris> how do they group data more complex than what a list of lists can handle?
<jmercouris> and who is "they" anyway? are there any anti-clos arguments I can read?
<_death> CL itself due to its history has CLOS almost as an addon.. so it's easy to imagine CL-sans-CLOS
<jmercouris> I'm using the expression in the sense of, "it would be very unfortunate", not that I cannot imagine it literally
<jackdaniel> it is not said that if there were no "clos" CL wouldn't incorporate other kind of OOP
<jmercouris> of course when I was learning Lisp (still learning of course), I did not yet know CLOS and was working without it
<jackdaniel> also object orientation and encapsulation are orthogonal concepts, you may write protocol for accessing complex data which has underlying structure in form of a vector whatsoever
<jmercouris> I know the other OO systems though, and I don't like them nearly as much, I can't think of an argument for them anymore
<jackdaniel> you just define functions to set and access data
<_death> DEFSTRUCT existed prior to CLOS, I believe
<jmercouris> sure you can, just how you could drop down into assembler, but abstractions that objects provide make it far easier to persist/access data
<jmercouris> and I will disagree with you object orientation and encapsulation are *NOT* orthogonal concepts
<jackdaniel> also using clos daily encourages sloppy code where there are dangling methods (and it is hard to follow how the program behaves)
<jmercouris> that is one of the big reasons behind Java's different type of class members, they are closely tied
<jmercouris> I will not say that one necessitates they other, but I will not say they are orthogonal
<shka_> i like clos
Bike has joined #lisp
<shka_> but i can understand why some would say that it is complex
<jmercouris> it is not a coincidence this section is in this article
<shka_> and makes programs complex
<shka_> because it can do that
<jmercouris> it can also do the exact opposite
<_death> shka: the funny thing is I remember reading AMOP for the first time and thinking how _simple_ much of CLOS is... :)
<jmercouris> any tool when misused can make things more complex
<jackdaniel> your premise were that you can't have complex data structures without oop
<shka_> jmercouris: if used correctly, yes
<jmercouris> My premise was "you cannot easily have complex data structures without OOP"
<jackdaniel> either way I see that you feel very emotional towards clos and oop in general, so I'll just back off
<jackdaniel> it is worth noting, that I was speaking about programming techniques (I am aware that every value in CL has its class)
<jmercouris> I think we know that, we aren't going to be *that* pedantic :D
<shka_> i really hope that beach will eventually finish his object oriented design book
<jmercouris> ah, I didn't know such a book existed
<jmercouris> is there a draft somewhere?
<shka_> it does not exist yet
<shka_> but there is a chapter online
<jmercouris> I didn't know such a bookw as in the process of coming into existence
<shka_> very well written
<shka_> beach is doing a lot of things, not very quickly though :P
<jmercouris> perhaps very thoroughly though...
<shka_> yeah
<shka_> let me find this chapter for you
<shka_> it is worth reading
<jmercouris> ok, thank you
<shka_> jmercouris: i can't seem to find it, sorry
<shka_> perhaps someone can help
<shka_> _death: indeed, thanks!
<shka_> jmercouris: _death kindly provided link
<jmercouris> taking look now, thanks
* _death feels like sharing yesterday's hack..
<shka_> _death: is that idiom or literally what you meant?
<shka_> ok
oni-on-ion has quit [Remote host closed the connection]
JohnMS has joined #lisp
JohnMS has quit [Client Quit]
JohnMS_WORK has quit [Ping timeout: 248 seconds]
ricekrispie has joined #lisp
svillemot has quit [Ping timeout: 257 seconds]
svillemot has joined #lisp
jmercouris has quit [Ping timeout: 246 seconds]
kdas_ has joined #lisp
kushal has quit [Remote host closed the connection]
kdas_ is now known as kushal
pankajgodbole has joined #lisp
dale_ has joined #lisp
dale_ is now known as dale
LiamH has joined #lisp
warweasle has joined #lisp
kushal has quit [Remote host closed the connection]
kushal has joined #lisp
beach has quit [Ping timeout: 252 seconds]
milanj has joined #lisp
beach has joined #lisp
zooey has quit [Remote host closed the connection]
zooey has joined #lisp
Lord_of_Life has quit [Ping timeout: 244 seconds]
Lord_of_Life has joined #lisp
jmercouris has joined #lisp
bobby has quit [Ping timeout: 245 seconds]
lnostdal has quit [Ping timeout: 272 seconds]
Achylles has quit [Ping timeout: 252 seconds]
Lycurgus has joined #lisp
schjetne has quit [Ping timeout: 258 seconds]
hjudt has joined #lisp
jprajzne has quit [Quit: Leaving.]
lnostdal has joined #lisp
Achylles has joined #lisp
sjl_ has joined #lisp
varjag has quit [Quit: ERC (IRC client for Emacs 25.2.2)]
Inline has joined #lisp
jmercouris has quit [Ping timeout: 245 seconds]
lnostdal has quit [Read error: Connection reset by peer]
lnostdal has joined #lisp
lnostdal has quit [Read error: Connection reset by peer]
anewuser has quit [Ping timeout: 248 seconds]
jmercouris has joined #lisp
lnostdal has joined #lisp
jkordani has quit [Ping timeout: 246 seconds]
pankajgodbole has quit [Ping timeout: 248 seconds]
v88m has quit [Read error: Connection reset by peer]
v88m has joined #lisp
heisig has quit [Quit: Leaving]
zhlyg has joined #lisp
Lycurgus has quit [Quit: Exeunt]
shifty has quit [Ping timeout: 248 seconds]
<markasoftware> i want to make a macro `with-modulo`. In its body, all basic arithmetic operations should have their results modulo'd. So, (with-modulo 5 (+ 4 2)) would be 1
<markasoftware> I'm unsure how I should properly override the + functions here
<beach> markasoftware: You can't override the version in the CL package.
<markasoftware> there's no way to lexically or dynamically bind an override?
<beach> clhs 11.1.2.1.2
<specbot> Constraints on the COMMON-LISP Package for Conforming Programs: http://www.lispworks.com/reference/HyperSpec/Body/11_abab.htm
<White_Flame> you could fiddle with the current package such that + reads as MY-PACKAGE:+ instead of CL:+
<White_Flame> you'd have to transform that back to CL:+ outside your with-modulo scope
jmercouris has quit [Ping timeout: 268 seconds]
<markasoftware> huh, i guess I'll just make +m, -m, *m, etc
<White_Flame> in SBCL you can unlock the CL package and fiddle with things like that even if you're not supposed to
<beach> It is fine to shadow + in your own package.
jmercouris has joined #lisp
<White_Flame> other implementations probably have the same
<Xach> In this case I think it would be appropriate to use a code walker but I do not know how easy or difficult that would be.
<_death> markasoftware: suppose you move (+ 4 2) to some function and call it in WITH-MODULO.. should it return the same result?
<markasoftware> i was planning for it to be lexical, so no
<markasoftware> i didn't think function binding was so different from value
<White_Flame> it's not that different; the difference is that the CL package is effectively locked
<_death> markasoftware: then as Xach said, one way is to use a walker.. if you like to live dangerously you can SUBLIS :)
<markasoftware> so, a walker would look through the forms in &body for any + to replace them?
<White_Flame> yes, the naive approach is to just walk the source as a list
<White_Flame> but you might miss things in backquotes and other reader macro stuff
<White_Flame> fare-quasiquote can normalize the backquote handling to sexprs
<White_Flame> plus, distinguishing between vars, function calls, etc in all the lisp-2 scopes is more difficult in a manual code walk
<White_Flame> but for the base case, simply searching the nested lists of &body source works
<markasoftware> i think i'll just take the easy route and use different functions for modulo arithmetic and normal arithmetic. Thanks for the insight!
<White_Flame> yep. It is often a pain point that the standard functions are not extensible or generic functions
<aeth> And the standard functions that are generic are a special kind of generic, not generic functions
gravicappa has joined #lisp
<lavaflow_> hey dumb question, but which software license is generally prefered by the lisp community?
<aeth> MIT seems to be the most common these days.
<lavaflow_> I was thinking, the most popular editor seems to be emacs, so maybe the lisp community likes the GPL too?
<lavaflow_> okay yeah that makes sense
<aeth> Licenses seem to match the general trend in licenses.
<lavaflow_> yeah, MIT seems pretty popular these days
zhlyg has quit [Remote host closed the connection]
<Xach> the most popular chainsaw is husqvarna but I do not speak swedish
<ckonstanski> Yesterday I asked about getting a lisp process to run in docker. Turns out the problem is not with lisp but rather with docker, and the solution also lies within docker. Add -t to the docker run command line to get a pseudo-TTY.
schweers has quit [Ping timeout: 248 seconds]
<aeth> Xach is probably the only one who could quantiatively tell you (1) how many projects are under a certain license and (2) if that trend has changed over time based on first commit in the repository.
<ckonstanski> The REPL cannot exist without a TTY, and therefore the lisp image dies as soon as it wants to land at the REPL.
<_death> could be there are a massive number of proprietary projects that you never heard of :)
<Bike> your lisp probably has an optiona to run something else instead of the repl, if that's the kind of thing you want to do
<aeth> ckonstanski: in SBCL it is sbcl --non-interactive --load path/to/your/file.lisp
<aeth> Other implementations probably have similar flags.
<aeth> You probably need to create a file to be run specifically for this purpose since it will call your main or whatever, which you wouldn't normally do automatically from the REPL.
<Xach> _death: that is one reason why i don't like an attitude like "I will break my interface and send patches to all projects that break" - how can you know what breaks below the surface?
<ckonstanski> --non-interactive makes the problem worse. Lisp exits as soon as it finishes loading and running whatever is in thte --load (or --userinit or whatever) parameter.
<White_Flame> is this supposed to be a server?
<ckonstanski> If you're trying to run a hunchentoot web server (for instance) that listens in the background, you have to keep the image alive after it'S done loading.
<aeth> ckonstanski: you probably want a loop to keep it alive, with a way to quit it, and a way to access it via swank, using an ssh-tunneled SLIME
<White_Flame> yes, the main thread should block until shutdown is requested
<Xach> _death: I don't mind a justified breaking of interfaces, but I find the idea that it is mitigated substantially somehow by sending patches around not great.
<aeth> Xach: not just proprietary projects, also e.g. Debian
<aeth> Sure, Debian will eventually get the upstream, years later.
<_death> Xach: definitely.. that is a very important pro for CL, that it's stable.. although when what you say happens I'm sometimes ambivalent because I believe the ecosystem is still small enough for it to make sense if the interface is very broken
<_death> bitrot doesn't just happen.. it is caused, sometimes manufactured :/
<Xach> I remember one message from the "big 5" standardization list: "I'd rather piss off a thousand RMSs than one MCC", which is not exactly my sentiment, but it is slightly related.
<Xach> Hmm, I guess it was in the k-machine stuff.
<pjb> ckonstanski: this is false. You can have a REPL without a TTY. For example, slime.
<pjb> ckonstanski: also, you don't need a REPL to run a lisp program in the background.
<ckonstanski> For purposes of docker though. Context matters.
<pjb> background as in, in a docker.
<White_Flame> ckonstanski: this is no different than a server in any other language. There's a "main thread is finished" behavior or equivalent that exits the program, that you need to block on
schjetne has joined #lisp
<White_Flame> and yes, the only REPL you should have on a server is a SLIME-served REPL
<White_Flame> (technically SWANK-served, but whatever)
<aeth> ckonstanski: You can do something like this: (defun main () (loop :until (zerop (random 10)) :do (sleep 1/10))) (main)
<aeth> Except instead of (random 10) it's a quit signal
<_death> Xach: hah.. don't release internal code so that customers won't use internal interfaces... :)
<White_Flame> aeth: or :use bordeaux-threads and do it properly :-P
<aeth> nah
<_death> Xach: I think I have some projects that I don't put up for that reason, amongst others ;)
igemnace has joined #lisp
hhdave has quit [Quit: hhdave]
elinow has quit [Quit: Leaving]
themsay has quit [Ping timeout: 268 seconds]
jxy has quit [Quit: leaving]
jxy has joined #lisp
jmercouris has quit [Ping timeout: 244 seconds]
ggole has quit [Quit: Leaving]
<Xach> /win 3
<markasoftware> How can I access a macro argument as a string?
<Xach> markasoftware: (princ-to-string argument)
<Xach> markasoftware: that is a little tongue in cheek. what prompts the question?
<markasoftware> i want to generate functions which are named +m, -m, *m, and /m, slightly modified versions of all the built-in arithmetic
<markasoftware> i want to make a macro (make-my-thing +) (make-my-thing /) etc
<markasoftware> i need to append the m
<markasoftware> but need to call the original arithmetic function inside the definition
<Bike> what does make-my-thing do?
<Xach> markasoftware: ok. you can get the name of a symbol as a string with (symbol-name symbol)
<markasoftware> Bike: it defines, say, +m as (mod (+ a b) *modulus*)
<markasoftware> i want these functions to all modulo their results by a global variable
<Bike> ah.
<_death> (make-my-thing +m +) is also an option
<Xach> symbol names that appear in sources as lowercase are by default read into lisp as uppercase, so if you make a symbol with a name of "m+" it will print funny, but it won't if you use "M+".
<markasoftware> and how do i go backwards, to convert a string to a symbol?
<White_Flame> clhs intern
<White_Flame> but you need to ensure it lands in the right package
<White_Flame> or if you want to create an uninterned symbol for temp use:
<White_Flame> clhs make-symbol
<White_Flame> neither of these will perform the read-case transformation, though. read-from-string can convert a string to a symbol, with the case transformation, *IF* it reads as a string
<White_Flame> although intern + string-upcase can be compatible enough
<White_Flame> oh, the alexandria library also has SYMBOLICATE, which is handy for building up symbols from parts
<White_Flame> although it doesn't seem to perform read-case conversion for you either
<markasoftware> so, (defun (intern whatever) body) ?
oni-on-ion has joined #lisp
voodooanon has joined #lisp
<Bike> you can just try intern and symbol-name and stuff in the repl to get a feel of how they work
<Xach> markasoftware: likely something more like `(defun ,function-name ,lambda-list ,@body)
voodooanon has left #lisp [#lisp]
nowhereman has joined #lisp
<_death> imagine if DEFINE-MODIFY-MACRO appended an F :)
<pjb> markasoftware: if it's whatever, why do you care giving it a name? Just (lambda ,lambda-list ,@body).
d_run has joined #lisp
<pjb> (intern "name with smaller case, and other <strange> \"characters\" and stuff.") #| --> |name with smaller case, and other <strange> "characters" and stuff.| ; nil |# works too ;-)
<pjb> (|and also| (|make my thing| +) /)
Oladon has quit [Ping timeout: 258 seconds]
<oni-on-ion> hmm " and | need to be different? ie. why wouldnt symbols and strings have more 'equality'?
moei has joined #lisp
<pjb> oni-on-ion: it's possible. The first LISP used commas to separate tokens. (foo |bar baz| quux) was written (FOO,BAR BAZ,QUUX)
<pjb> ie. spaces were significant!
<oni-on-ion> ohhh thats quite interesting =)
terpri has joined #lisp
<_death> it also didn't have strings
<pjb> (PRINT,HELLO WORLD)
<oni-on-ion> i notice that hemlock (and clim listener?) use space for completion. (also it uses Real Word Command rather than real-word-command)
<pjb> but you couldn't print a comma :-)
<oni-on-ion> heh those things
<oni-on-ion> in a way looking back, it could make sense as we-use-hyphens-for-spaces-instead nowadays
<_death> I'm reminded of those javascript testing frameworks with it("should not break too hard", function() { ... })
pierpal has quit [Ping timeout: 248 seconds]
specbot has quit [Remote host closed the connection]
minion has quit [Remote host closed the connection]
minion has joined #lisp
specbot has joined #lisp
<Xach> o for a macro
Jesin has quit [Quit: Leaving]
nowhere_man has joined #lisp
nowhereman has quit [Ping timeout: 258 seconds]
ckonstanski has quit [Read error: Connection reset by peer]
ckonstanski has joined #lisp
pierpal has joined #lisp
<_death> (defmacr 'defmacr)
Jesin has joined #lisp
pierpal has quit [Quit: Poof]
pierpal has joined #lisp
dpl has joined #lisp
mulk has quit [Ping timeout: 244 seconds]
ckonstanski has left #lisp ["ERC (IRC client for Emacs 26.2)"]
ravenous_ has joined #lisp
karlosz has joined #lisp
polezaivsani has joined #lisp
Zaab1t has joined #lisp
Zaab1t has quit [Client Quit]
bexx has joined #lisp
themsay has joined #lisp
sauvin has quit [Ping timeout: 252 seconds]
themsay has quit [Ping timeout: 272 seconds]
kajo has joined #lisp
<didi> What is the interval of `f' in <http://www.lispworks.com/documentation/HyperSpec/Body/t_float.htm>: "f is a positive integer between b^p-1 and b^p-1 (inclusive)"
<Bike> might mean between b^(p-1) and (b^p)-1
<jgodbout> Note: The requested URL /documentation/HyperSpec/Body/t_float.htm>: was not found on this server.
<didi> Bike: Thank you.
<Bike> the hyperspec did real bad with those arithmetic expressions for some reason
themsay has joined #lisp
hiroaki has joined #lisp
Arylla has joined #lisp
Arylla has quit [Quit: leaving]
warweasle has quit [Quit: rcirc on GNU Emacs 24.4.1]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
rdh has joined #lisp
captainmalloc has joined #lisp
vlatkoB has quit [Remote host closed the connection]
captainmalloc has quit [Quit: ERC (IRC client for Emacs 26.2)]
donotturnoff has quit [Ping timeout: 246 seconds]
kajo has quit [Ping timeout: 248 seconds]
gravicappa has quit [Ping timeout: 248 seconds]
varjag has joined #lisp
kajo has joined #lisp
polezaivsani has quit [Remote host closed the connection]
pierpal has quit [Read error: Connection reset by peer]
pierpal has joined #lisp
ravenous_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Xach> Yesterday I got DSA signature verification working for the quicklisp client.
<Xach> I have to rethink the representation of keys to better support expiration and other metadata, but things are progressing.
zhlyg has joined #lisp
<zhlyg> in sbcl/slime is the call-site saved in the backtrace?
amerlyq has quit [Quit: amerlyq]
mulk has joined #lisp
pierpal has quit [Ping timeout: 245 seconds]
<Xach> zhlyg: it depends on the debug level. it isn't always by default.
<zhlyg> Xach: Oh, cause I think I saw it, but then it was gone, didn't belive my eyes.. has fiddled with (debug 3).
<zhlyg> Xach: Thank you! I was bitten by the top-level proclaim wart. Putting declare inside the functions made it work!
<xristos> Xach: does it depend on cl+ssl or ironclad?
<Xach> xristos: no and no.
<xristos> you might want to look at eran gat's sc4 for a self-contained solution
<Xach> it adapts some ideas from ironclad.
<Xach> xristos: I would like for people to sign things with existing tools rather than self-contained new tools.
<nirved> Xach: why DSA and not ECDSA?
t58 has joined #lisp
polezaivsani has joined #lisp
<Xach> nirved: I am working through RFC 4880 and it is not part of it. i am not opposed to adding it in the future.
malm has quit [Ping timeout: 258 seconds]
<Xach> It is a work in progress.
cosimone has joined #lisp
malm has joined #lisp
dpl has quit [Read error: Connection reset by peer]
themsay has quit [Read error: Connection reset by peer]
themsay has joined #lisp
LiamH has quit [Quit: Leaving.]
schjetne has quit [Ping timeout: 252 seconds]
kushal has quit [Remote host closed the connection]
kushal has joined #lisp
Bike has quit []
varjag has quit [Quit: ERC (IRC client for Emacs 26.1)]
sjl_ has quit [Quit: WeeChat 2.3-dev]
torbo has joined #lisp
moei has quit [Quit: Leaving...]
cosimone has quit [Quit: WeeChat 2.3]
zhlyg has quit [Ping timeout: 272 seconds]
hiroaki has quit [Ping timeout: 248 seconds]
hiroaki has joined #lisp
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 272 seconds]
wxie has joined #lisp
v88m has quit [Ping timeout: 248 seconds]
[X-Scale] has joined #lisp
[X-Scale] is now known as X-Scale
X-Scale` has quit [Ping timeout: 245 seconds]
Bike has joined #lisp
makomo has quit [Ping timeout: 248 seconds]
wxie has quit [Quit: wxie]
kajo has quit [Quit: From my rotting body, flowers shall grow and I am in them and that is eternity. -- E. M.]
v88m has joined #lisp
cpc26 has quit [Read error: No route to host]
ebrasca has quit [Remote host closed the connection]
cpc26 has joined #lisp
Lycurgus has joined #lisp
polezaivsani has quit [Quit: ERC (IRC client for Emacs 26.2)]
pjb has quit [Remote host closed the connection]
shifty has joined #lisp