jackdaniel 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.5.4, CMUCL 21b, ECL 16.1.3, CCL 1.11.5, ABCL 1.5.0
frgo has quit [Ping timeout: 276 seconds]
lxbarbosa has quit [Read error: Connection reset by peer]
<DrDuck> how close is this to lisp capabilities? https://github.com/julvo/reloading
Codaraxis has quit [Ping timeout: 245 seconds]
frgo has joined #lisp
Codaraxis has joined #lisp
enrio has joined #lisp
<White_Flame> you can write something like that in lisp as well, probably easier
<White_Flame> built-in lisp capabilities for hot edits are at the full expression level, not the subexpression (like an inner loop body) level
<White_Flame> so if teh loop called a function, you could hot-redefine the function every iteration if you wanted, without anything special
<no-defun-allowed> Trivial. Lots of things are redefinable by default in Lisp, and SLIME makes it easier than walking.
t58_ has joined #lisp
<DrDuck> so common lisp can't do what that library for python does by default?
<White_Flame> see also let-over-lambda for retaining state in a closure while execution does other stuff
frgo has quit [Ping timeout: 240 seconds]
<White_Flame> DrDuck: why would any langauge reload source from files constantly? that's slow. No designer woudl add that by default, especially in an industrial language like CL
<White_Flame> obviously that python lib is for live demonstration purposes
<DrDuck> o_o
<no-defun-allowed> Not like that, you have to give Lisp the redefining form yourself.
t58 has quit [Ping timeout: 246 seconds]
fanta1 has quit [Quit: fanta1]
<aeth> DrDuck: if you want to see live coding taken to an extreme in Common Lisp, check out CEPL. https://github.com/cbaggers/cepl
<White_Flame> one wonders what would happen if you save with a syntax error with that python tool
<aeth> DrDuck: lots of C-c C-c to recompile top level forms in those presentations
<aeth> Except that library does the work to reload things on the GPU as well.
frgo has joined #lisp
<aeth> You sometimes have to do extra work to prevent the program from continuing to execute stale code, especially if you do something fancy like write shaders for OpenGL with your library.
<aeth> The default, though, is basically that if you recompile a file while the image is running with SLIME (or something similar) then the updated definitions will be used. Recompiling a top-level form will mostly work, but sometimes compiler optimizations get in the way of that because compilers are allowed to optimize a file heavily and SBCL sometimes does
synaps3 has joined #lisp
synaps3 has quit [Changing host]
synaps3 has joined #lisp
bitmapper has quit []
synaps3 has quit [Client Quit]
superkumasan has quit [Ping timeout: 268 seconds]
t58_ has quit [Quit: Leaving]
Codaraxis has quit [Read error: Connection reset by peer]
frgo has quit [Ping timeout: 240 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
superkumasan has joined #lisp
frgo has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
cseder has quit [Ping timeout: 268 seconds]
cseder has joined #lisp
frgo has joined #lisp
stux|RC has quit [Read error: Connection reset by peer]
stux|RC has joined #lisp
frgo has quit [Ping timeout: 268 seconds]
frgo has joined #lisp
smazga has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
smazga has quit [Ping timeout: 268 seconds]
frgo has quit [Ping timeout: 240 seconds]
X-Scale` has joined #lisp
X-Scale has quit [Ping timeout: 240 seconds]
X-Scale` is now known as X-Scale
frgo has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
frgo has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
Josh_2 has quit [Read error: Connection reset by peer]
frgo has joined #lisp
semz has quit [Ping timeout: 250 seconds]
khisanth_ has quit [Ping timeout: 268 seconds]
Josh_2 has joined #lisp
ebzzry has quit [Ping timeout: 252 seconds]
semz has joined #lisp
semz has joined #lisp
semz has quit [Changing host]
khisanth_ has joined #lisp
orivej has quit [Ping timeout: 240 seconds]
frgo has quit [Ping timeout: 240 seconds]
lxbarbosa has joined #lisp
frgo has joined #lisp
v0|d has joined #lisp
toorevitimirp has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
<hdasch> minion: registration, please?
<minion> The URL https://gitlab.common-lisp.net/users/sign_in?secret=ebc7a0f4 will be valid until 03:00 UTC.
akoana has left #lisp ["Leaving"]
frgo has joined #lisp
davr0s_ has joined #lisp
davr0s has quit [Ping timeout: 265 seconds]
davr0s__ has quit [Ping timeout: 265 seconds]
davr0s has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
defn has joined #lisp
shifty has joined #lisp
defn has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
frgo has joined #lisp
APic has quit [Ping timeout: 240 seconds]
frgo has quit [Ping timeout: 240 seconds]
abhixec has quit [Remote host closed the connection]
Arcaelyx has joined #lisp
smazga has joined #lisp
frgo has joined #lisp
_whitelogger has joined #lisp
Arcaelyx has quit [Quit: Arcaelyx]
Lord_of_Life has quit [Ping timeout: 240 seconds]
Lord_of_Life_ has joined #lisp
Lord_of_Life_ is now known as Lord_of_Life
Arcaelyx has joined #lisp
ebzzry has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
Bike has quit [Quit: Lost terminal]
frgo has joined #lisp
toorevitimirp has quit [Ping timeout: 268 seconds]
frgo has quit [Ping timeout: 240 seconds]
enrio has quit [Read error: Connection reset by peer]
nika has joined #lisp
jeosol has joined #lisp
mulk has quit [Quit: ZNC - http://znc.in]
<beach> Good morning everyone!
mulk has joined #lisp
<aeth> good morning beach
lxbarbosa has quit [Remote host closed the connection]
cseder has quit [Ping timeout: 276 seconds]
cseder has joined #lisp
malm has quit [Quit: Bye bye]
ebzzry has quit [Read error: Connection reset by peer]
ebzzry has joined #lisp
karlosz has joined #lisp
_whitelogger has joined #lisp
frgo has joined #lisp
dddddd has quit [Remote host closed the connection]
gravicappa has joined #lisp
APic has joined #lisp
cseder has quit [Read error: Connection reset by peer]
cseder has joined #lisp
smazga has joined #lisp
ebzzry has quit [Read error: Connection reset by peer]
vlatkoB has joined #lisp
ebzzry has joined #lisp
Fade has quit [Ping timeout: 265 seconds]
smazga has quit [Ping timeout: 265 seconds]
quazimodo has quit [Ping timeout: 268 seconds]
frgo has quit [Ping timeout: 240 seconds]
ebzzry has quit [Read error: Connection reset by peer]
froggey has quit [Ping timeout: 265 seconds]
orivej has quit [Ping timeout: 268 seconds]
quazimodo has joined #lisp
froggey has joined #lisp
shka_ has joined #lisp
Arcaelyx has quit [Quit: Arcaelyx]
rippa has joined #lisp
rixard has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 240 seconds]
quazimodo has joined #lisp
techquila has quit [Remote host closed the connection]
techquila has joined #lisp
karlosz has quit [Quit: karlosz]
frgo has joined #lisp
McParen has joined #lisp
vlatkoB has quit [Remote host closed the connection]
Duuqnd has joined #lisp
vlatkoB has joined #lisp
Duuqnd_ has quit [Ping timeout: 245 seconds]
manualcrank has quit [Quit: WeeChat 1.9.1]
vlatkoB has quit [Remote host closed the connection]
vlatkoB has joined #lisp
vlatkoB has quit [Remote host closed the connection]
vlatkoB has joined #lisp
davisr has quit [Ping timeout: 265 seconds]
lxbarbosa has joined #lisp
vlatkoB has quit [Remote host closed the connection]
vlatkoB has joined #lisp
dale has quit [Read error: Connection reset by peer]
dale has joined #lisp
raghavgururajan has quit [Remote host closed the connection]
superkumasan has quit [Ping timeout: 265 seconds]
fanta1 has joined #lisp
dale has quit [Quit: My computer has gone to sleep]
frgo has quit [Ping timeout: 240 seconds]
rixard has joined #lisp
ggole has joined #lisp
fanta1 has quit [Quit: fanta1]
frgo has joined #lisp
enrio has joined #lisp
rixard has left #lisp [#lisp]
frgo has quit [Ping timeout: 240 seconds]
fanta1 has joined #lisp
superkumasan has joined #lisp
gxt has quit [Ping timeout: 260 seconds]
fanta1 has quit [Quit: fanta1]
cseder has quit [Quit: $ sudo rm -rf /]
marusich has quit [Remote host closed the connection]
libertyprime has joined #lisp
varjag has joined #lisp
agspathis has joined #lisp
makomo has joined #lisp
ralt has joined #lisp
gxt has joined #lisp
decent-username has joined #lisp
<decent-username> I'm right now writing a function with a #'macrolet inside. The question is: How can I access the arguments of the function that envelops the #'macrolet?
<beach> Why do you write #' in front of "macrolet"?
<decent-username> I dunno
<beach> If you mean the parameters of the function around the MACROLET, then you just write their names.
<decent-username> I just write #' infront of everything that's a function or a macro
random-nick has joined #lisp
<beach> But you can not do that at macro-expansion time, because the corresponding arguments are not available then.
<decent-username> it's probably wrong for macros
<beach> It is.
<decent-username> I'll show you the code and you'll understand what I'm trying to do.
<beach> I need to go fix lunch for my (admittedly small) family. You either need to wait or see if someone else can answer.
<decent-username> no worries
<decent-username> I'll try to solve the problem on my own. I'll let you know if I've managed to fix it.
<decent-username> Here's the code: https://paste.gnome.org/puvqnmc4y
<decent-username> take your time
<decent-username> the code is still rather messy and doesn't compile properly
<MichaelRaskin> You don't need to unescape global-cell-x (the macro should expand to literally this symbol), and you do need to put comma before x (it is a macro argument that should be substituted in macro expansion
<decent-username> I've just realized my code doesn't really make a lot of sense
<lieven> minor nit - in loop you can replace "to (1- bound)" with "below bound"
<lieven> and make-array has an initial-contents initarg to replace setting them by hand
orivej has joined #lisp
<decent-username> lieven: Thanks.
<decent-username> my code compiles now. But the logic is still more broken than a 80year old who fell down a skyscraper.
orivej has quit [Ping timeout: 240 seconds]
makomo has quit [Ping timeout: 268 seconds]
gareppa has joined #lisp
scymtym has quit [Ping timeout: 240 seconds]
<beach> decent-username: It is conventional to put the loop keywords at the beginning of a line, not at the end.
<decent-username> beach: here's the new code btw.
<decent-username> the commented block is the portion that gives me trouble: I get the following error message: "The value -1 is not of type SB-INT:INDEX"
<beach> (when (not ...)...) is better expressed as (unless ... ...)
<beach> decent-username: Then you look at your backtrace, type a `v' in the frames, and look at what form is causing problems.
<beach> It must be the case that global-cell-x or global-cell-y is 0, so that adding -1 to it gives -1 which you then use to pass to AREF.
orivej has joined #lisp
<decent-username> beach: Slime highlight the entirety of #'find-wall-features
edgar-rft has quit [Ping timeout: 276 seconds]
<decent-username> the whole form
<beach> What value of DEBUG did you compile your code with?
<decent-username> I'm not sure what DEBUG refers to.
<decent-username> So I guess the default value?
<beach> I always put (proclaim '(optimize (speed 0) (compilation-speed 0) (debug 3) (space 0))) in my .sbclrc
<decent-username> What does that accomplish?
<beach> clhs optimize
<beach> It makes sure you have the best possible values for debugging.
<decent-username> (proclaim '(optimize (debug 3))) seems to be useful
<decent-username> Now I get information about the state of every variable. NICE!
<decent-username> Yeah, looks like I try to access outside the array. Makes sense.
<decent-username> *access memory
jonatack has joined #lisp
lispyone has quit [Quit: Connection closed for inactivity]
edgar-rft has joined #lisp
toorevitimirp has joined #lisp
scymtym has joined #lisp
<decent-username> It works! Here's the code I've written to the best of my current ability: https://gitlab.com/decent-username/undead-dungeon/blob/master/third-party/dungen/src/corridor.lisp
manualcrank has joined #lisp
heisig has joined #lisp
toorevitimirp has quit [Ping timeout: 268 seconds]
<decent-username> I've modified mfianos Dungen library, because the created tiles don't contain enough information in order to decide which wall-sprite to use.
ebzzry has joined #lisp
ECLIPSE has joined #lisp
<ECLIPSE> hi,would someone please help me to understand this lisp code,or beautifier it so I can read it,https://justpaste.it/3mr1e
<no-defun-allowed> I think I will go with "no", since it's probably some kind of deobsfucation attempt at...AutoLisp or something like that? Some CAD scripting language.
<Duuqnd> ECLIPSE: I'm pretty sure that's not Lisp. At least not anymore.
<decent-username> It isn't even syntactically correct
makomo has joined #lisp
<ECLIPSE> its a lisp code for AutoCad malware
<Duuqnd> ECLIPSE: Not anymore. That's just text soup.
<no-defun-allowed> CAD malware? That's new.
<no-defun-allowed> I think we'd need the actual file rather than trying to poke out strings out of it.
clothespin has quit [Ping timeout: 250 seconds]
<ECLIPSE> I am started studying lisp to understand ,,, and I was wondering about syntax ) ,,,, so I think its an advanced way to write lisp
<ECLIPSE> lol
<no-defun-allowed> But, also "we" would have to be some other group, since this is a Common Lisp room and low-key AutoLisp is an unholy abomination.
<no-defun-allowed> One of the things malware writers probably have in mind is to obsfucate their code, so I would not use it for learning unless you want to learn reverse engineering too.
<decent-username> ECLIPSE: So advanced in fact, that it doesn't even qualify as a Lisp anymore.
<decent-username> LOL
<ECLIPSE> ok, Thank you
<no-defun-allowed> What a weird propagation vector though.
Bike has joined #lisp
<ECLIPSE> there is an hidden character in the file '=D
<ECLIPSE> I think its a lisp now O:3
<ECLIPSE> but what is the first comment mean ?
<Bike> is this supposed to be as unreadable as possible
LiamH has joined #lisp
<ECLIPSE> @Bike , its AutoCad malware ,,,, it was obfuscated with spaces and /n /r ,, after I removed them I got this code ,,,,, but it still there is some points in code that I can not understand ,,, like first comment and the last one
<ECLIPSE> and strcat also ,,, I can not understand data structure in lisp
<Bike> this channel is for common lisp, not whatever autocad has
<ECLIPSE> ;( its a lisp code
<Bike> this channel is about a specific language, and this is not it
<Bike> if those comments actually mean something, it's very specific to autocad
<edgar-rft> ECLIPSE: for AutoLisp better ask in ##lisp, nearly nobody here woks with it
McParen has left #lisp [#lisp]
<ECLIPSE> edgar-rft thanks
<ECLIPSE> Cannot send to nick/channel D: =$
ECLIPSE has left #lisp [#lisp]
lucasb has joined #lisp
<decent-username> I'm about 90% sure ECLIPSE is a bot. If it now starts to talk to me, then that's even more suspicous.
<decent-username> :O
<decent-username> or maybe it's just extreme autism
<edgar-rft> what is somewhat equal to a normal AutoLisp user
dddddd has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
<beach> decent-username: Like I said, the convention is to put LOOP keywords at the beginning of a line rather than at the end.
<beach> decent-username: Also, page 13 of the LUV slides by Pitman and Norvig has some interesting points. For instance, you should not use a non-Boolean variable in a position that "requires" a Boolean. So when you write (WHEN CELLS ...) you are violating this expectation.
<beach> decent-username: And when you write (LET (RESULTS) ...) the message is that RESULTS is "uninitialized" and the person reading your code expects the variable to be assigned to before it is used. But you used it as if it were a list. In that case, you should write (LET ((RESULTS '())) ...)
<decent-username> Thanks for the tips.
<beach> Sure.
lnostdal has quit [Ping timeout: 240 seconds]
__jrjsmrtn__ has joined #lisp
<beach> decent-username: Here is another one: WHEN and UNLESS should be used only in a context where the value is not needed. This expectation is violated when you write (LAMBDA (X) (WHEN (CARVED-P X) X))
_jrjsmrtn has quit [Ping timeout: 276 seconds]
<beach> decent-username: In a context where the value is needed, use an IF with both branches. So, depending on the message you want to send to the person reading your code, either (LAMBDA (X) (IF (CARVED-P X) X NIL)) [if the value is a default value or a Boolean], (LAMBDA (X) (IF (CARVED-P X) X '())) [if the value is the empty list], or (LAMBDA (X) (IF (CARVED-P X) X 'NIL)) [if the value is the symbol NIL].
<beach> decent-username: One more: Instead of writing (setf (cell-features (aref grid x y)) (cons ... (cell-features (aref grid x y)))) it is preferable to write (push ... (cell-features (aref grid y))). In addition, you then avoid multiple evaluations of (aref grid x y).
<beach> But, especially, it is much more explicit, since it uses a construct that is the most specific that does the job. That's a general rule in programming. Use the most specific construct that will do the job.
<beach> I also recommend replacing RECURSE with a LOOP.
<beach> And if you decide to keep the recursive version, a recursive function should always be structured like a proof by induction, i.e. by handling the base case first. So it should read (if (null cells) nil (let* ....))
decent-username has quit [Ping timeout: 240 seconds]
jonatack has quit [Ping timeout: 268 seconds]
* beach can now see that this energy was wasted.
analogue has joined #lisp
_whitelogger has joined #lisp
<jeosol> beach: the energy was not wasted at all. There are others that read the code and learn from the style recommendation, how to write better code and design
<jeosol> btw, I have a comment above: do you mean (when name ...) should only be used if name is some boolean, or like predicate
EvW1 has joined #lisp
<beach> Yes, that is the recommendation by Norvig and Pitman. And I agree with them.
<beach> And thanks.
<jeosol> nice, should reread that document again.
<beach> This is also why we have two functions NULL and NOT that do the same thing. NOT takes a Boolean argument, whereas NULL takes a list or a default value.
<jeosol> btw, I am not disagreeing, just want to keep refactoring and writing better code
<beach> I understand.
narendraj9 has joined #lisp
<jeosol> I see.
<jeosol> You heard about Grahams Bel lisp. What are your thoughts briefly. This is probably discussed here before.
<beach> I haven't looked at it. I consider the introduction of new Lisp dialects unnecessary, and I don't understand the reason.
<jeosol> I have the same feeling. Not sure why he is doing that,
<beach> By the way, it doesn't matter much whether we agree or not. Those two people are WAY more experienced than I am, especially when it comes to creating industrial-strength software written by a team of highly experienced professionals.
<jeosol> There was Arc seemed not to have gone anywhere
<beach> Right. Paul Graham is different.
<jeosol> I see, but could that effort not be put in improving the current one, especially if syntax or ideas is close to CL
<beach> We seem to be having two parallel subjects.
<jeosol> I did ask him a question on twitter a while back, when I started working on my application with CL using CLOS and someone mentioned I will have production issues. I asked him, he said he won't recommend CL at this (that) time but will recommend Clojure.
<jeosol> I checked it out, but stayed with CL.
<beach> I might recommend something other than Common Lisp as well, depending on the context. I don't think there is a general-purpose recommendation.
<jeosol> Well, I was coming from C/C++
gareppa has quit [Quit: Leaving]
<jeosol> which was not bad per see, but I was looking to write a large application, the image-based development probably got me to stick to CL in the initial phase.
<beach> A language such as C++ is very hard to use for large applications. At least if you want your application to be both modular and fast. I often say that it is impossible to do that.
<beach> The problem is the manual memory management. If your application is truly modular, you can not predict what references to objects might be kept by a particular module.
<beach> As Paul Wilson says "Liveness is a global property".
<jeosol> Yes, that was the main issue I was having, layering the classes, organization packages, etc. It was getting difficult so decided to explore something else.
<beach> Yeah.
<beach> So then, to keep modularity, the C++ programmers either copy everything or they resort to reference counting. Both of which are slow.
<jeosol> I saw a CL code for a C/C++ code I wrote. Very concise and the easier to read and was doing more in a few pages that my massive C/C++ code base. The lisp code was for a genetic algorithm some guy wrote for his dissertation.
<beach> And it doesn't even work all the time.
<beach> I see.
<jeosol> That's what got me to start exploring the language.
<jeosol> Is there a technical name when a language is few syntax constructs to memorize? Saw something a while ago, but I can't recall
decent-username has joined #lisp
<beach> jeosol: Not sure.
<jeosol> I think this is what helps with my coding in CL. I often also have to work in python, pandas, numpy, and the argument keywords, changes here and there. It's hard to keep track and things aren't uniform
<jeosol> with CL, I just focus on the application, know how things are structured, not a lot of mental burden.
xkapastel has joined #lisp
enrio has quit [Ping timeout: 240 seconds]
<beach> I believe you.
igemnace has joined #lisp
<Josh_2> wait
narendraj9 has quit [Remote host closed the connection]
<Josh_2> beach: you wrote all that I am not completely lost xD Is this little snippet of code https://plaster.tymoon.eu/view/1518#1518 wrong? I don't understand
<Josh_2> also what is the LUV?
chip2n has quit [Ping timeout: 265 seconds]
Necktwi has joined #lisp
enrio has joined #lisp
orivej has quit [Ping timeout: 268 seconds]
<beach> Josh_2: I don't see any problems relating to the issues I just talked about.
<beach> But I personally don't assign to parameters. I prefer introducing new ones with LET.
<beach> Oh, and I think (listp ignore-positions) is always true.
<beach> And, I would put the (IF FROM-START inside the INTERN.
<beach> To avoid repetition of FORMAT, the string, and "KEYWORD".
<beach> And that double REVERSE looks fishy too.
<beach> It looks like it ought to be using BUTLAST instead of SUBSEQ.
<beach> Josh_2: ^ all that for you.
<mfiano> I am the author of most of the code that those suggestions were based upon. I never intended the code to be used by others, and my style choices are a little outside the norm to fit my own mental model. Also some of them were for performance considerations. That is why I use Lisp to begin with :)
decent-u` has joined #lisp
<beach> mfiano: Oh, sorry. I just assumed Josh_2 exposed it in order to get feedback.
<beach> mfiano: What performance considerations did you have in mind? Are they specific to a particular Common Lisp implementation?
FreeBirdLjj has joined #lisp
decent-username has quit [Ping timeout: 240 seconds]
<mfiano> Way back when, it was tested on SBCL and CCL. Mostly algorithm and data structure optimizations - I don't think I went as far as to add compiler-specific type annotation optimizations.
<beach> I see. Well I apologize again. And again, my energy was wasted. Oh, well.
<mfiano> It was not. No need to apologize.
lxbarbosa has quit [Remote host closed the connection]
lxbarbosa has joined #lisp
<mfiano> It's just that I never inteded anyone to use that. I assumed it would stay on my GitHub for me alone, like everything else I write :)
<mfiano> The flexibility of the language, both style and not, is why I use Lisp. Otherwise I'd probably have stuck with Python 15 years ago :)
<mfiano> The Python philosphy is the language that comes to mind with "only one way to do something"
<beach> I see.
<mfiano> I believe the reason Lisp is so powerful is because of this flexibility. I also believe it's why everyone reinvents the wheel. For most things, it's usually easier to rewrite it yourself to match your own thought processes and use cases, since the original was probably a one-man effort for their specific use-case. After all, code is just a projection of one's own mind.
<beach> I read somewhere that understanding code written by others is roughly as hard as writing your own. And that was supposedly not related specifically to Common Lisp.
<beach> Therefore, I personally think that good documentation is essential.
<beach> And I don't mean documentation strings extracted to HTML or something similar.
orivej has joined #lisp
<mfiano> I agree with that. Writing code to be consumed by others is harder than both in my opinion though, even if it has documentation. It's much easier to write code for a particular use-case. Once you start adding users to the mix, edge cases and bugs are found, several refactors and years later, you have a robust piece of software, or a piece of software outside of the original vision.
<mfiano> DOn't have any bugs? (incf *users*) :)
enrio has quit [Quit: Leaving]
<beach> Indeed. It is harder, but also more rewarding when you find an abstraction that feels right and that can be expressed in the documentation in a useful way.
<vsync> nicely put
<vsync> beach: interesting, those recommendations, since I deliberately do the opposite for many of them... I may try to reread that chapter to see what the reasoning is. what were the slides you mentioned?
enrio has joined #lisp
<beach> It is all about saving time for unknown people trying to understand your code. So if you don't think you will have unknown people trying to understand your code, of if you don't care about wasting their time, you can write whatever you please.
jonatack has joined #lisp
<vsync> yeah, I find that interesting... for example I find (let (foo) bar baz (when foo qux)) more accessible even in foreign code.
igemnace has quit [Ping timeout: 246 seconds]
<vsync> but I value the falseness of empty lists as a feature, not a bug or a dirty programming trick. that's not because it's intrinsically valuable but because it's a part of CL heritage and a key part of CL definition.
<beach> So you mean you prefer having absolutely no idea whether foo is going to be assigned to, whether it is an empty list, whether it is a symbol, or whether it is the Boolean false after you see (let (foo) ?
<beach> I MUCH prefer knowing so that I don't have to guess.
igemnace has joined #lisp
<beach> You are confusing semantics and communication.
<vsync> and, it is obvious to all that a language which allows for shorter programs is strictly superior to one which requires longer.
<vsync> ;-P --^ I had a page on Everything2 back in the day asserting that car and cdr were superior to first and rests... but the deletionists got to it, in the days before wikipedia
<vsync> the empty list is Boolean false
<vsync> as for knowing in advance, CL may be the wrong language to demand that in, but you are welcome to use type-declarations; they are the right tool for the job and I often use them myself
<beach> So, some great people came up with this convention, and it wasn't me. And many people use it. So when many people use it, it saves time to know that when you see (let (foo), then foo is "uninitialized" and you expect it to be assigned to before being used. If you now don't respect that convention, you will have all those experienced people confused when they read your code.
<beach> Because, they expect it to be assigned to and it isn't.
<mfiano> The empty list should not be used as boolean false
<mfiano> See 1.4.1.4.4
<beach> vsync: So then when they see the variable used, they have to go back and check how it was initialized.
<vsync> you are confusing your personal thought process with objective truth
<beach> vsync: Not at all. I am talking about Norvig and Pitman. Not me.
<beach> As in two highly experienced developers and software engineers who have worked on industrial projects in teams with many people.
<vsync> beach: but some great people also came up with the language, and they did it first, and then people write programs in the language
<vsync> btw in that example I selected 2 of the examples together because I would find the whole correct. but it makes complete sense to have something initialized then to check later whether it has been set to anything, or anything has been added to the set that it is
<vsync> I'm interested in seeing their arguments and will read that chapter
<beach> vsync: Like I said before, you do what you like.
cosimone has joined #lisp
<vsync> mfiano: you are conflating notation with semantics; and in the example (let (foo)) one sees neither NIL nor ()
<beach> It is interesting to see people who do NOT believe in making life easier for people reading their code.
<vsync> that is an interesting leap of logic in your ad hominem
<vsync> beach: you seem to be arguing "these guys used conventions somewhere; therefore everyone should use those conventions everywhere"
<beach> Absolutely.
<beach> That's what "conventions" mean.
orivej has quit [Ping timeout: 265 seconds]
<vsync> I use the convention that variables starting with i are integers
<beach> Especially when established by highly qualified, highly experienced programmers and software engineers.
<vsync> Norvig is a traitor though so his moral authority is quite suspect
<beach> vsync: "Conventions" are by definition shared. It is not a "convention" if only you respect it.
<vsync> beach: exactly
<vsync> you find this convention persuasive because it matches the way you think. but I don't, because it doesn't match mine.
<DrDuck> vsync: how is norvig a traitor? haha xD
<beach> vsync: Thanks for letting us know.
<vsync> and you come perilously close to something like describing it as "intuitive"
<vsync> DrDuck: he's all about Python now
<DrDuck> :P
<vsync> and finds it superior, and advocates its use above CL
<DrDuck> i wonder why
<vsync> he talks about it somewhere
<vsync> but here is the irony
<vsync> first, if one wants to write approachable CL code, one should throw away CL and write the code in Python. because Norvig established the convention that Python is easier to understand.
<vsync> rest, the degeneracy of this argument is exposed because Norvig claims Python is closer to his pseudocode... and yet he should therefore use ALGOL which is the official language for pseudocode
<vsync> ...as would be the convention
<DrDuck> ^^
Arcaelyx has joined #lisp
<vsync> incidentally I was having a casual conversation with my friend who became enraged upon finding out that one would denote keywords by bolding them, and that one could write in a variant which used local language for keywords... I find it a beautiful idea that would be difficult to gain purchase and suspect it never did
<mfiano> There's also a difference between confentions that lend to better readability, and conventions that lent to better readability.
<Kabriel> that's not quite right; I think he was trying to appease his students
<Kabriel> he talks about it here: http://www.norvig.com/python-lisp.html
<vsync> mfiano: can you expound your pun please?
<mfiano> One example would be the 80 column limit from a time when we didn't have modern displays or operating systems.
<vsync> indeed, but in our modern age we no longer have modern displays but instead short-screens; it becomes useful to have short lines in windows one can arrange horizontally
Lord_of_Life_ has joined #lisp
<mfiano> Or on the Python note, 79 columns ;)
Lord_of_Life has quit [Ping timeout: 250 seconds]
Lord_of_Life_ is now known as Lord_of_Life
lxbarbosa has quit [Ping timeout: 276 seconds]
<mfiano> It'd be rare to find a document on the web with such a limitation, or even trying to contain a typical URI in a code comment, especially if not at the top-level. Eh, I tile windows horizontally on two of my displays (the 3rd is vertical for long macro-expansions etc), and I don't have a problem even with a 100 column limit and 4 horizontal windows on either of them.
orivej has joined #lisp
enrio has quit [Max SendQ exceeded]
enrio has joined #lisp
<Kabriel> vsync: yeah, doesn't seem all that different than the link I sent. He likes it for communicating his topics, but it was driven by students having issues with CL.
FreeBirdLjj has quit [Remote host closed the connection]
igemnace has quit [Ping timeout: 240 seconds]
ebzzry has quit [Read error: Connection reset by peer]
ebzzry has joined #lisp
enrio has quit [Read error: Connection timed out]
enrio has joined #lisp
nullman has quit [Ping timeout: 246 seconds]
nullman has joined #lisp
Smokitch has joined #lisp
ljavorsk has joined #lisp
lxbarbosa has joined #lisp
ljavorsk has quit [Ping timeout: 250 seconds]
akoana has joined #lisp
scymtym has quit [Ping timeout: 245 seconds]
orivej has quit [Ping timeout: 268 seconds]
xkapastel has quit [Quit: Connection closed for inactivity]
<Josh_2> beach: that was my code that I posted
<Josh_2> beach: thanks for the suggestions, i changed the intern but as for the defaulting to true, that is only the case with the default values, the function is by another function which provides those values, so It's fine for it to always be true
patrixl has quit [Remote host closed the connection]
decent-u` has quit [Ping timeout: 276 seconds]
makomo has quit [Quit: WeeChat 2.4]
<Josh_2> beach: what about this? https://plaster.tymoon.eu/view/1519#1519 I introduced a new variable and removed the double format
<Josh_2> as for the double reverse, well to be honest I can't remember what It's doing oof
<Josh_2> It's been a while since I've had proper time to finish this library :(
<Josh_2> here is a tripply improved version https://plaster.tymoon.eu/view/1520#1520
anewuser has joined #lisp
notzmv has joined #lisp
<mfiano> That could be improved quite a bit more
shifty has quit [Ping timeout: 240 seconds]
<Josh_2> darn no
<Josh_2> lol
<mfiano> It suffers from repeating the same expensive operation more than once, and on multiple ocassions. Before that though, I would focus on proper indentation before asking others to read code
Inline__ has joined #lisp
Inline__ has quit [Read error: Connection reset by peer]
<Josh_2> That's not my fault
<Josh_2> It's plaster
<Josh_2> It's indented just fine in my emacs
Inline__ has joined #lisp
<Josh_2> here is attempt 3000000 https://plaster.tymoon.eu/view/1522#1522
Inline__ has quit [Read error: Connection reset by peer]
<Josh_2> also so what if it is doing reverse a bunch of times, when I have a library I'm happy with I can optimize
Inline__ has joined #lisp
Inline has quit [Ping timeout: 264 seconds]
<Josh_2> https://imgur.com/pZLM7FO.png here it is on emacs
<mfiano> It's not just reverse. It's also length which is done twice in one branch when it never changes, and is expensive on lists, and subseq conses up a new list twice, likewise for reverse, and more
<mfiano> Well only one list consed for subseq, but in combination with reverse is painful to look at for me
<Shinmera> Josh_2: The indentation //is// your fault because you're mixing tabs and spaces.
<Josh_2> I mostly use tabs
<Josh_2> mostly
<Shinmera> Well you shouldn't for this exact reason.
<Josh_2> no
<Josh_2> ima use tabs It's easier
<Josh_2> perhaps I can tell emacs to insert 4 spaces instead
<Josh_2> okay, I removed repeat calls to length :P but as for the subseq/reverse stuff, I cant' remember what I'm doing so Ima just leave it
<Josh_2> also I'm working with lists that are pretty darn short, so all this consing etc isn't expensive
<beach> Josh_2: (LISTP '()) => true.
<beach> So unless it can be an atom that is not NIL, then you can remove the test.
EvW1 has quit [Ping timeout: 245 seconds]
<Josh_2> beach: it is only true for the default arguments
<beach> I don't understand.
<Josh_2> but the calling function provides arguments
<beach> Yes, and can that function pass, say, a symbol or a number?
<beach> Or does it always pass a list, or nothing?
<Josh_2> it will pretty much always pass '(0)
<beach> So since LISTP is true for the empty list and the non-empty list, then it is always true, unless the caller passes say 'hello or 234.
<Josh_2> You can pass a symbol, it won't do anything
<Josh_2> well the user could pass "ree" if they wanted
<Josh_2> and if I don't do the check then a few functions will be passed with that arg and everything will die
<beach> And it is desirable to not signal an error in that case?
<beach> That would be a bit strange.
<Josh_2> why would I need to signal an error when I can just ignore it/
<beach> You need to read Bertrand Mayer. It is always desirable to signal an error when there is an anomaly. you should never hide it.
<Bike> it might indicate that the calling code is doing something you don't expect it to, which you might be interested in knowing.
LiamH has quit [Quit: Leaving.]
<Josh_2> hmm
<beach> But I don't think I can handle much more arguing about basic software-engineering ideas tonight.
<beach> Sorry.
<Josh_2> well I wouldn't have considered it arguing
<Bike> for example if you write (foo x) somewhere but meant (foo y).
<Bike> if an error is signaled because x is the wrong type, you can find the problem pretty fast.
<beach> OK, then I don't think I can handle lengthy justifications of my position on elementary software engineering, with the risk of having those positions questioned, tonight.
<Josh_2> I'm only asking because I don't know...
<beach> Whew!
<beach> Then, yes, always signal an error if there is a chance that the caller might do something wrong.
<beach> Elementary software engineering. Read Bertrand Meyer.
heisig has quit [Quit: Leaving]
<Josh_2> Any particular book?
<beach> I read that stuff a few decades ago, so I don't remember.
EvW has joined #lisp
Inline__ has quit [Quit: Leaving]
<beach> Look for "programming by contract"
<beach> I think he invented that term.
<beach> There is a Wikipedia entry on "Design by contract".
<beach> That will do for a start.
<beach> The contract here would be "the client must pass a list, or nothing at all".
<beach> You check that the client respects the contract and you signal an error if not.
<beach> This technique makes life easier for the person who has to debug defective code, because failure to respect the contract will then not be allowed to propagate more than absolutely necessary.
<Josh_2> well that makes sense
easye has quit [Read error: No route to host]
<Josh_2> alrighty I'll do some reading on that
Inline has joined #lisp
<beach> But I should learn not to get involved in people's personal preferences by quoting elementary software-engineering ideas. The subsequent discussions tend to make me upset, and that's not good for me.
<beach> Josh_2: Not talking about your or anybody else in particular.
<beach> Anyway, I am off to spend time with my (admittedly small) family.
<jeosol> beach: again, i know it's good for advise to be received or least pointers in the right direction. You are doing a good service here.
<beach> Thanks.
<jeosol> I get pointers from the comments you make to others to improve my code. The back-and-forth on some issues can be frustrating. I'll let you run to family now.
lxbarbosa has quit [Remote host closed the connection]
<beach> Yes, she is waiting. I'll be back tomorrow (UTC+2).
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
<jeosol> Enjoy your the rest of your weekend.
<beach> Thanks.
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
shka_ has quit [Ping timeout: 245 seconds]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
heisig has joined #lisp
easye has joined #lisp
lemoinem is now known as Guest82150
Guest82150 has quit [Killed (tolkien.freenode.net (Nickname regained by services))]
lemoinem has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
cosimone has quit [Quit: Quit.]
shka_ has joined #lisp
Necktwi has quit [Quit: leaving]
heisig has quit [Ping timeout: 240 seconds]
vlatkoB has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
scymtym has joined #lisp
augfab has quit [Ping timeout: 240 seconds]
augfab has joined #lisp
dale has joined #lisp
Josh_2 has quit [Ping timeout: 240 seconds]
nika has quit []
notzmv has quit [Remote host closed the connection]
Suzuran has joined #lisp
<Suzuran> I came to share this; https://imgur.com/gallery/2AxVkjL
<Shinmera> oof, the condition of those tapes
<Suzuran> If you think the tapes are bad you should see the machines
<Suzuran> We're actually not doing too bad as far as data recovery goes; We're batting above 80% so far.
<Suzuran> In fact, a tape just finished:
<Suzuran> "Dump completed: Read 803 files having 6659 blocks (23986176 bytes), of which 59 blocks contained data errors."
<Shinmera> Impressive
krid has joined #lisp
<Suzuran> We had one tape that came back no errors at all, it was really short and didn't have a lispm header; It turned out to be someone's copy of Spacewar for Unix (for old pre-SunOS Suns)
cosimone has joined #lisp
agspathis has quit [Remote host closed the connection]
krid has quit [Ping timeout: 268 seconds]
shka_ has quit [Ping timeout: 240 seconds]
orivej has joined #lisp
Smokitch has quit []
shka_ has joined #lisp
Lycurgus has joined #lisp
mfiano has quit [Quit: WeeChat 2.5]
mfiano has joined #lisp
mfiano has quit [Client Quit]
mfiano has joined #lisp
clothespin has joined #lisp
edgar-rft has joined #lisp
ralt has quit [Quit: Connection closed for inactivity]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
gravicappa has quit [Ping timeout: 265 seconds]
davisr has joined #lisp
ggole has quit [Quit: Leaving]
enrio has quit [Ping timeout: 240 seconds]
Fade has joined #lisp
libertyprime has quit [Ping timeout: 268 seconds]
C-16 has quit [Quit: leaving]
lemoinem is now known as Guest8276
Guest8276 has quit [Killed (card.freenode.net (Nickname regained by services))]
lemoinem has joined #lisp
anewuser has quit [Quit: anewuser]
EvW has quit [Ping timeout: 246 seconds]
mindthelion has joined #lisp
bitmapper has joined #lisp
techquila has quit [Ping timeout: 264 seconds]
LiamH has joined #lisp
libertyprime has joined #lisp
EvW1 has joined #lisp
Suzuran has quit [Quit: POPJ P,]
Lycurgus has quit [Quit: Exeunt]
Posterdati has quit [Ping timeout: 240 seconds]
cosimone has quit [Quit: Quit.]
kajo has joined #lisp
permagreen has quit [Remote host closed the connection]
permagreen has joined #lisp
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 265 seconds]
Arcaelyx has quit [Quit: Arcaelyx]
hiroaki_ has quit [Remote host closed the connection]
hiroaki has joined #lisp
hiroaki has quit [Ping timeout: 268 seconds]
lavaflow has quit [Ping timeout: 245 seconds]
EvW1 has quit [Ping timeout: 250 seconds]
nowhere_man has joined #lisp
shka_ has quit [Ping timeout: 240 seconds]
karlosz has joined #lisp
ebzzry has quit [Ping timeout: 240 seconds]
ebzzry has joined #lisp
housel has quit [Ping timeout: 276 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
Fare has joined #lisp
clothespin has quit [Ping timeout: 265 seconds]
random-nick has quit [Ping timeout: 250 seconds]
flubberhead has joined #lisp
DGASAU has quit [Ping timeout: 240 seconds]
notzmv has joined #lisp
jmercouris has joined #lisp
housel has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Ping timeout: 240 seconds]
varjag has quit [Ping timeout: 268 seconds]
lavaflow has joined #lisp
EvW has joined #lisp
LiamH has quit [Quit: Leaving.]
frgo has joined #lisp
libertyp1ime has joined #lisp
quazimodo has quit [Ping timeout: 265 seconds]
varjag has joined #lisp
varjag has quit [Ping timeout: 240 seconds]
frgo has quit [Ping timeout: 268 seconds]