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
torbo has joined #lisp
Marlin1113 has quit [Remote host closed the connection]
nowhereman has quit [Ping timeout: 245 seconds]
libertyprime has quit [Quit: leaving]
<aeth> pjb: (1) alexandria has some macros to simplify that and (2) I think Common Lisp can run on a real time machine
<dialectic> seok: Helpful hint. Only write your program using functions. When you find yourself repeating the same thing over and over, then you can reach for defmacro.
nowhereman has joined #lisp
quazimodo has joined #lisp
Clama has joined #lisp
Clama has quit [Client Quit]
notzmv has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
nowhereman has quit [Ping timeout: 245 seconds]
Clama has joined #lisp
Clama has quit [Client Quit]
Lycurgus has quit [Quit: Exeunt]
nonlinear has quit [Quit: The Lounge - https://thelounge.github.io]
ebrasca has quit [Remote host closed the connection]
GoldRin has quit [Remote host closed the connection]
nonlinear has joined #lisp
scymtym has quit [Ping timeout: 246 seconds]
NB0X has joined #lisp
techquila has quit [Read error: Connection reset by peer]
NB0X has left #lisp [#lisp]
techquila has joined #lisp
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #lisp
FreeBirdLjj has quit [Ping timeout: 245 seconds]
DGASAU has quit [Read error: Connection reset by peer]
Lord_of_Life has quit [Ping timeout: 272 seconds]
Lord_of_Life has joined #lisp
rumbler3_ has joined #lisp
rumbler3_ has quit [Ping timeout: 258 seconds]
dialectic has quit [Ping timeout: 272 seconds]
sauvin_ is now known as Sauvin
dialectic has joined #lisp
Lycurgus has joined #lisp
bugrum has joined #lisp
gxt has quit [Ping timeout: 260 seconds]
gxt has joined #lisp
_whitelogger has joined #lisp
Lycurgus has quit [Quit: Exeunt]
torbo has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 248 seconds]
nanoz has joined #lisp
_whitelogger has joined #lisp
pjb has quit [Remote host closed the connection]
pygmypuppy has quit [Ping timeout: 248 seconds]
<beach> Good morning everyone!
rumbler3_ has joined #lisp
dddddd has quit [Remote host closed the connection]
rumbler3_ has quit [Ping timeout: 244 seconds]
wigust has joined #lisp
mepian has quit [Quit: Leaving]
wigust- has quit [Ping timeout: 272 seconds]
<vsync> dialectic: though I find it handy to (partly) write in the language I wish I had... or is that an advanced technique?
<dialectic> The person I'm talking to is a new lisp user.
<vsync> then I agree with you
<vsync> and I would say as well, when you do write macros, write them in terms of functions as much as possible... that tripped me up earlier on when I first got really into macros
<dialectic> How do you mean?
<vsync> problems I ran into were: 1) doing too much restructuring or especially building of code constructs "inline" in the macro rather than factoring out; 2) having all the generated code be inline even when it could be factored out into a function call
<vsync> helps debugging to have my macro call functions to do its work and the generated code sometimes call functions to do its work... and found the resulting code clearer as well
<aeth> Basically never write macros. Eventually you'll find some boilerplate that will frustrate you enough that you'll break that rule. Some exceptions could be made for ones that fit established patterns like define-foo, with-foo, and do-foo
* vsync likes the concept of "never do this... except when you do" generally speaking
<aeth> And, yes, if you're writing functions, put most of the generation work into functions or at least LET variable bindings and have the actual quasiquoted macro look like this: `(let ,(generate-bindings foo bar) ,@(pre-body bar baz) ,@body ,@post-body)
<aeth> s/functions/macros with functions/
<vsync> aeth: would you support those constructs being recognized as first-class things with language support, e.g., DEFDEFINER, DEFWITHER?
<aeth> vsync: yes
<aeth> vsync: INCF-style macros are trivial because of define-modify-macro
<vsync> (I only just learned the other day of DEFINE-MODI...yup
<aeth> A define-define that covers 90% of the cases when you want to make a defun or global defparameter/defvar/defconstant, as well as a define-with that covers the basic with-pattern of unwind-protect, would help a lot
<aeth> define-do would be harder since you could base your do-foo on loop, do, tagbody/go, or even higher order functions like map
<vsync> I'm just annoyed that there's never the PROG variant I want predefined
<aeth> (and I was using an inclusive or, do-foo could be quite elaborate in its iteration)
<vsync> it would be nice if DO just had some default or option for init-form and step-form
<aeth> vsync: make your own!
<dialectic> PROG sucks. :/
<vsync> I guess "leave it alone" counts as that but it seems less common
<aeth> vsync: DO is structurally an extremely simple TAGBODY with GO and a LET binding around it
<vsync> yes, in protest I use only raw TAGBODY
<aeth> and DO* just uses LET* (and I guess SETF instead of PSETF?)
<dialectic> DO also sucks. Please use LOOP or just a regular ol tagbody.
<aeth> vsync: You can just use the implicit tagbody in DO and confuse people (and probably tools like Emacs)
<vsync> I don't need the LET because all extra binding is done in &aux
<aeth> dialectic: people only hate DO because they never use it... you can do amazing things with it
<aeth> the thing DO gets you is the ability to MACROEXPAND-1 it and see how it is implemented, and how it is probably implemented with only a few differences in other implementations
<aeth> You're not going to have a fun time introspecting your LOOP
<vsync> LOOP sucks
<dialectic> I am an open minded person. I let DO into my life. DO let me down. I no longer use DO.
<dialectic> Any macro which makes me commit to memory a totally arbitrary syntax is a design failure.
<aeth> The best DOs are zero-body DOs. If you have a body (that's more than just declarations) you're probably doing something that would be clearer with some other iteration form (or defining your own)
<aeth> Some limited side effects like print in the body are also acceptable
<dialectic> A DO that has no body is almost always clearer as a LOOP anyway. And in a loop I have the option of splitting the initialization and iteration.
<dialectic> And... I can also throw in arbitrary body forms, interspersed with the iteration code. It is just so much more readable, but I get this is preference.
<aeth> dialectic: A DO is only clearer as a LOOP if you don't think that you should use the simplest iteration that accomplishes the task
<LdBeth> Usually it’s clearer to use map/mapcar
vlatkoB has joined #lisp
<LdBeth> Compare to DO
<aeth> LdBeth: map/mapcar is extremely clear... if the thing you're iterating with is a function, like (mapcar #'first list)
<aeth> If there's a huge body it might not be the best choice
<aeth> s/huge body/lambda with a huge body/
<aeth> dialectic: the only simple iteration that works fine in DO that I think is clearer in LOOP is something like where you're reading because there you have (foo (read-whatever ...) (read-whatever ...)) vs. :for foo := (read-whatever ...)
<aeth> and you really shouldn't have to repeat yourself
<aeth> although, to be fair, a DO purist might just write a macro on top of DO for that
<aeth> LOOP could give you a deleting unreachable code note/warning if the ":for foo := (read-whatever ...)" is only run once since it's technically generating two things, too.
<aeth> iirc
<dialectic> You keyword the = symbol? That's even crazier.
<LdBeth> Why not?
<aeth> dialectic: because I want my editor to highlight it like a keyword, and, as an added benefit, I get a pseudo-Pascal :=
<aeth> LOOP is a mini-ALGOL-like language where e.g. "for" is a keyword (in non-Lisp terms) but by making it ":for" it's also a keyword in Lisp terms and is highlighted specially
<LdBeth> I’d avoid messing with lots of parentheses
<aeth> dialectic: and besides, the first time I used the LOOP example with keywords, I didn't put "s around it or otherwise distinguish it, but it was immediately clear that the "for" wasn't prose
<vsync> whatever makes LOOP appear more as the abomination it is is proper
<aeth> LdBeth: I love messing with lots of parentheses, and as much as I've gotten used to LOOP, I don't like that it's :for foo :in bar instead of (:for foo :in bar)
<aeth> or at least (for foo :in bar)
<vsync> aeth: do you like ITERATE?
<ck_> sounds like you'd prefer iterate
<aeth> vsync: no
<aeth> I love what I thought ITERATE was before I tried to use it :-)
<vsync> LOL how do they differ?
<aeth> I literally just want LOOP with parentheses, more compatability
<aeth> ITERATE is its own thing
<LdBeth> aeth: (:for ...) is ok, since it can make the structure clear
<LdBeth> I don’t like having many parentheses in one line
<aeth> LdBeth: which is why it would use a plist... it would be mostly loop compatible but order wouldn't matter
<aeth> There might be some LOOP forms where it can't be represented as unique keys, though. Not sure.
<aeth> Obviously besides stuff like (:for ...) which would be their own expressions
<aeth> The only reason I haven't done this yet is because reimplementing LOOP would be a lot of work, even if I might be able to get away with implementing a lot of it IN loop
<stylewarning> I don’t get people who dislike loop
<stylewarning> It gets the job done and rarely sacrifices correctness
<aeth> stylewarning: I don't dislike LOOP, I literally just want LOOP with parentheses for more Lispiness, and ITERATE fans pitch it as that, but it's not
<stylewarning> We write the biggest LOOPs at work
<stylewarning> 5 pager LOOPs
<aeth> stylewarning: numeric?
<stylewarning> No, just smelly code
<aeth> my biggest loops have been implementing numeric algorithms, and the :of-type double-float all over the place doesn't help keep it brief
<aeth> not multiple pages though
<aeth> (or maybe my font is just smaller)
<stylewarning> aeth: they’re mostly weird traversal algorithms for compilers
<stylewarning> It’s not pretty code, it just works tho
<aeth> stylewarning: that probably counts too since it's the same principle just a different domain (translating massive algorithms)
<aeth> I didn't see the point of LOOP before this besides somethings like collect
libertyprime has joined #lisp
libertyprime has quit [Client Quit]
<stylewarning> (PRs welcome 🙏)
notzmv has joined #lisp
<aeth> (by "this" I meant translating complex algorithms into CL and not your code, btw)
<stylewarning> (:
CloseToZero has joined #lisp
CloseToZero has quit [Remote host closed the connection]
CloseToZero has joined #lisp
zhlyg has joined #lisp
nanoz has quit [Ping timeout: 248 seconds]
frgo has quit [Ping timeout: 245 seconds]
chris4197 has joined #lisp
keep_learning_M has joined #lisp
rumpelszn has quit [Ping timeout: 245 seconds]
rumpelszn has joined #lisp
Oladon has joined #lisp
dialectic has quit [Ping timeout: 258 seconds]
marusich has joined #lisp
CloseToZero has quit [Read error: Connection reset by peer]
CloseToZero has joined #lisp
CloseToZero has quit [Remote host closed the connection]
CloseToZero has joined #lisp
rumbler3_ has joined #lisp
rumbler3_ has quit [Ping timeout: 244 seconds]
CloseToZero has quit [Read error: Connection reset by peer]
CloseToZero has joined #lisp
JohnMS_WORK has joined #lisp
jprajzne has joined #lisp
thesorton has quit [Ping timeout: 272 seconds]
hiredman has quit [Remote host closed the connection]
stacksmith has quit [Remote host closed the connection]
keep_learning_M has quit [Quit: Leaving]
marusich has quit [Remote host closed the connection]
hiredman has joined #lisp
thesorton has joined #lisp
hiredman has quit [Ping timeout: 246 seconds]
frgo has joined #lisp
hhdave has quit [Quit: hhdave]
hiredman has joined #lisp
dialectic has joined #lisp
rumbler3_ has joined #lisp
rumbler3_ has quit [Ping timeout: 258 seconds]
sindan has joined #lisp
FennecCode has quit [Quit: ERC (IRC client for Emacs 26.2)]
dialectic has quit [Remote host closed the connection]
krwq has joined #lisp
krwq has quit [Remote host closed the connection]
zagura has quit [Ping timeout: 246 seconds]
themsay has quit [Ping timeout: 246 seconds]
scymtym has joined #lisp
dialectic has joined #lisp
manualcrank has quit [Quit: WeeChat 1.9.1]
zagura has joined #lisp
CloseToZero has quit [Remote host closed the connection]
CloseToZero has joined #lisp
CloseToZero has quit [Remote host closed the connection]
ggole has joined #lisp
linack has joined #lisp
linack has left #lisp [#lisp]
hhdave has joined #lisp
slyrus_ has joined #lisp
slyrus__ has quit [Ping timeout: 272 seconds]
hhdave has quit [Ping timeout: 268 seconds]
Oladon has quit [Read error: Connection reset by peer]
hhdave_ has joined #lisp
drot has quit [Quit: Quit.]
drot has joined #lisp
amerlyq has joined #lisp
SaganMan has joined #lisp
v88m has quit [Read error: Connection reset by peer]
pfdietz has quit [Remote host closed the connection]
pankajgodbole has joined #lisp
v88m has joined #lisp
JohnMS_WORK has quit [Read error: Connection reset by peer]
JohnMS_WORK has joined #lisp
Lycurgus has joined #lisp
random-nick has joined #lisp
hiredman has quit [Ping timeout: 246 seconds]
hiredman has joined #lisp
dialectic has quit [Ping timeout: 272 seconds]
zotan has quit [Ping timeout: 244 seconds]
Lycurgus has quit [Quit: Exeunt]
zotan has joined #lisp
q3d has joined #lisp
zagura has quit [Ping timeout: 244 seconds]
zagura has joined #lisp
chris4197 has quit [Remote host closed the connection]
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Remote host closed the connection]
chris4197 has joined #lisp
froggey has quit [Ping timeout: 244 seconds]
froggey has joined #lisp
q3d has quit [Remote host closed the connection]
q3d has joined #lisp
ym555 has quit [Ping timeout: 248 seconds]
CloseToZero has joined #lisp
seok has quit [Remote host closed the connection]
hiredman has quit [Ping timeout: 268 seconds]
frgo has joined #lisp
q3d has quit [Remote host closed the connection]
hiredman has joined #lisp
SaganMan has quit [Ping timeout: 248 seconds]
frgo has quit [Ping timeout: 268 seconds]
frgo has joined #lisp
v88m has quit [Ping timeout: 272 seconds]
DGASAU has joined #lisp
m00natic has joined #lisp
CloseToZero has quit [Remote host closed the connection]
pankajgodbole has quit [Ping timeout: 245 seconds]
Clama has joined #lisp
Clama has left #lisp [#lisp]
Clama has joined #lisp
jxy has quit [Quit: leaving]
jxy has joined #lisp
scymtym has quit [Ping timeout: 250 seconds]
scymtym has joined #lisp
<luis> aeth: LOOP is useful for many things besides collect. Parallel iteration, for instance. Also, iterating over sequences. And of course, it shines when you want to do all of those things at once.
<jackdaniel> DO* anyone? ;)
<luis> Heh.
<ck_> somebody already said that the true way is TAGBODY and GO
<jackdaniel> real programmers use prog! ,-)
<luis> ck_: you can probably hack slime to make it always show the macroexpansion of loop inline using macrostep-expand. That way you could see the true way at all times.
<jackdaniel> luis: is it possible to make slime inline macroexpand things put under macrolet?
<luis> jackdaniel: yes, that should work.
<jackdaniel> hum, it did not work for me, let me see
<jackdaniel> ah, it does
<jackdaniel> I don't know where did I get the impression that it does not work
<jackdaniel> thank you
xkapastel has joined #lisp
patrixl has quit [Remote host closed the connection]
libertyprime has joined #lisp
<luis> jackdaniel: looking at swank-macrostep::enclose-form-in-context, it looks like the mechanism can sometimes fail, so you might have come across one of those scenarios. Also, it doesn't work for slime-expand-1 (C-c RET)
<ck_> luis: speaking about slime, we talked about the trace dialog
<ck_> luis: there's slime-trace-dialog-autofollow-mode, which was maybe originally intended to do something like we discussed (?), but it is acting pretty weird when I set it. Do you have any experience with that?
Clama has quit [Ping timeout: 246 seconds]
<ck_> also, adding the outline-mode-like behaviour is still on my todo list
GoldRin has joined #lisp
ItsMarlin has quit [Ping timeout: 246 seconds]
<luis> ck_: it doesn't seem to do anything for me. What behaviour are you seeing?
<ck_> depending on [mysteries of the universe], it opens the inspector on the thing below the point
<luis> ck_: inspector or *trace-detail*?
Marlin1113 has joined #lisp
<ck_> luis: *trace-detail*
Achylles has joined #lisp
Lycurgus has joined #lisp
scymtym has quit [Ping timeout: 250 seconds]
piotr has joined #lisp
<piotr> hello
piotr is now known as FIlystyn
<FIlystyn> how to put read-line into a list ?
<FIlystyn> I read soemting right ? A line of txt and I would like to put it in list
<FIlystyn> content1: hue content2: hua
orivej has joined #lisp
<jdz> FIlystyn: You want the lines of a file as a list?
JohnMS_WORK has quit [Read error: Connection reset by peer]
Bike has joined #lisp
JohnMS_WORK has joined #lisp
dddddd has joined #lisp
<ck_>
<FIlystyn> jdz no
<FIlystyn> i just want to read-line and put it in the list
<jdz> (list (read-line ...))
<FIlystyn> just this way huh
<FIlystyn> and how to store it in variable ? defvar xyz (list ... )
<jdz> (defvar *xyz* (list (read-line ...)))
<jdz> But that's not a very good idea.
<jdz> Because you're probably reading the line from a stream, and the stream should not be always open, and you should be using WITH-OPEN-FILE (or at least WITH-OPEN-STREAM).
<jdz> So the question is: what is it you're really trying to do?
<FIlystyn> I want to read user input and put it in variable
<FIlystyn> maybe push ( list ( read-line ) ) ?
<jdz> Yes, you can have a (defvar *user-input* nil), and then push there.
<no-defun-allowed> (push (read-line) *your-output-list*)
<jdz> But you probably don't want to push single-element lists, just (push (read-line ...) *user-input*).
<no-defun-allowed> FIlystyn: have you written any other Lisp? That's not valid Lisp syntax, nor does it look very nice.
<FIlystyn> it actualy worked
<FIlystyn> im complete beginer
<no-defun-allowed> Uh, push ( list ( read-line ))?
<no-defun-allowed> It's not correct, because you can't ignore the outermost layer of parens.
<FIlystyn> ( push ( list ( read-line ) ) *var* )
<FIlystyn> that worked
<no-defun-allowed> Right, that's better. Now, you can remove the spaces between parens and names.
<jdz> s/can/should
<no-defun-allowed> And as jdz said, you don't need to put the string into a list to push it.
<no-defun-allowed> clhs push
<dlowe> FIlystyn: you might be interested in joining #clschool later
<FIlystyn> ok I will see but if there will be low respond on channel I will be back here
<no-defun-allowed> Yeah, you should never have any space between names and their closest parens basically.
<FIlystyn> why spaces are bad ?
<no-defun-allowed> And you will probably get better responses on #clschool, even if there's less participants.
<FIlystyn> ihm
<FIlystyn> ok ill go there now
Bike has quit [Remote host closed the connection]
kajo has quit [Ping timeout: 252 seconds]
FIlystyn has left #lisp [#lisp]
Bike has joined #lisp
t58 has joined #lisp
libertyprime has quit [Quit: leaving]
cosimone has joined #lisp
karlosz has quit [Remote host closed the connection]
karlosz has joined #lisp
<jackdaniel> [narrator] he did not
pfdietz has joined #lisp
<ck_> :D
<dlowe> jackdaniel: haha, I was thinking just the same thing
<pfdietz> A problem that LOOP or ITERATE (or any complex macro) should address: how can code walkers descend into this without expanding the macro?
<dlowe> maybe if macros were defined as a collection of matched patterns ;)
<pfdietz> Maybe someone could concoct such a scheme.
<dlowe> someone with a lot of guile
<Bike> why shouldn't they expand the macro?
<dlowe> depends on what the code walkers are trying to do
<dlowe> often they *are* macros
<pfdietz> The general problem is: do something to all the forms in a piece of program text. So, how do you find all those forms?
<dlowe> trying to add some functionality based on the surface appearance
<pfdietz> The old example I keep looking at is Waters' COVER package. It adds coverage annotations at all the branch points in code (inside a DEFUN or whatever).
<pfdietz> And it has to cheat a bit to do that. And as a result, it doesn't work with code that uses ITERATE.
frgo has quit [Remote host closed the connection]
<Bike> shivers's loop involves some kind of "low level" macros; skimmed the paper, don't really get it, still has something called syntax-rules
<chris4197> I am really liking lisp so far. Even though I just know the basics of the basics so far.
<chris4197> Maybe gonna try to do a json/xml parser with it.
<Bike> 2800 lines uncommented... that's actually longer than xerox loop. wow
<chris4197> Gonna try to extract some data, I think.
<chris4197> Good idea for a first more "complex" project?
Tristam has quit [Remote host closed the connection]
GoldRin has quit [Ping timeout: 245 seconds]
GoldRin has joined #lisp
Tristam has joined #lisp
<jackdaniel> if you like melding with CL implementations I can suggest ECL, if you like clos-ology I can suggest McCLIM (I'm working on both projects so I will be able to help)
frgo has joined #lisp
<jackdaniel> if you look for some other bits and pieces you may look at projects at sharplispers group on github and try to fix issues in them
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
patrixl has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
Lord_of_Life_ has joined #lisp
Lord_of_Life has quit [Ping timeout: 245 seconds]
Lord_of_Life_ is now known as Lord_of_Life
Lycurgus has quit [Quit: Exeunt]
ebrasca has joined #lisp
rumbler31 has joined #lisp
Inline has joined #lisp
szmer has joined #lisp
mindCrime has joined #lisp
JohnMS_WORK has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
rumbler31 has quit [Ping timeout: 244 seconds]
kajo has joined #lisp
Achylles has quit [Remote host closed the connection]
NickBusey has quit [Ping timeout: 248 seconds]
anewuser has joined #lisp
saravia has joined #lisp
<pfdietz> chris4107: there are json and xml parsers in CL already. Best to just use an existing one. If you feel the need to hack on one, improving test suites is always welcome.
<pfdietz> chris4197 I mean
<chris4197> I explicitly want to do it myself to learn it.
<Xach> "cl-ppcre but for octet sequences" would be cool
<Xach> and it doesn't already exist, i don't think
<chris4197> cl-ppcre?
<Xach> a fast character regex engine
warweasle has quit [Quit: be back later.]
<chris4197> Yeah, by FAR not good enough for that.
<Xach> I think it would be easier than xml but not as easy as json processing, and also when you're done you'd have something useful
<Xach> (to the world, it would of course be a useful learning experience)
<chris4197> Easier than xml?
<chris4197> Oh, you mean full xml parse.
<chris4197> I only want to retrieve certain data from it, so no general parser.
<chris4197> Sorry for the confusion.
<Xach> cl-ppcre source code is also very interesting to read and worth studying to learn CL features
<jdz> Xach: What would you use the regex matcher for octet sequences for?
<Xach> jdz: i would use it to decide how to process network data without first converting it to strings, which is costly in both time and space on my favorite CL (sbcl)
<Xach> same with file formats too
<Xach> but if the data is utf-8 or ascii or whatever, being able to find interesting subsequences and doing targeted conversion would be handy
<chris4197> Oh, you mean utf 8 to something else?
<chris4197> I don't think I get it.
<Xach> Here's the thinking. Converting 100mb to strings to search for the string "foobar" is more wasteful than converting the string "foobar" to octets and searching without conversion.
sjl has joined #lisp
<Xach> I love that strings and characters are not integers in CL, but it is not without cost
<Xach> So I am thinking about ways to be economical about the cost
<Xach> This comes up when parsing binary data in structured formats, whether on disk or over the network or whatever.
<jdz> Xach: In my case I'm also looking for interesting bits in binary blobs, but then sometimes the blobs are UTF-16 encoded strings, and such thing would not help much, so I'm always converting.
<Xach> jdz: why would it not help much?
<Xach> it seems like it would help much!
<jdz> Well, every other octet is 0. If I was looking for a specific string, then yes. But I'm looking for patterns.
<jdz> Maybe I should just think about this some more :)
<Xach> jdz: patterns that you can find with ppcre after conversion?
<jdz> Xach: Yes. I understand that such patterns can be translated from string into binary form.
<Xach> I think it could help but perhaps I am wrong.
smazga has joined #lisp
lucasb has joined #lisp
<Xach> Oh, and it's incomplete to say it only comes up in binary contexts. A text file is a binary file on disk. Writing grep with cl-ppcre loses because the conversion is expensive. If you matched without converting it would lose less.
<jdz> I still have not proved to myself that this change https://github.com/jdz/cl-ppcre/commit/89d89c8477841d83ff7d83b26cdf51aaea9ce76e should be merged upstream, but it works for me.
<jdz> Xach: Yes, I agree.
<chris4197> So, convert matching string into binary and then treat as binary data?
<jdz> But then, I think that not confusing octets with characters is a really great feature of CL (just look at all the Python2 vs. Python3 mess0.
<Xach> chris4197: yes. but with all the features of a regular expression system.
<Xach> jdz: yes, certainly!
sz0 has joined #lisp
<Xach> chris4197: so that matching "a+" means looking for #(... 97 97 97 ...)
<Xach> or #(... 0 97 0 97 0 97 ..) if that's the encoding...
<chris4197> The operators by themselves shouldn't be too hard.
<chris4197> Introducing the | and such blows up the complexity though.
<Xach> chris4197: cl-ppcre is a really fun read and shows a cool way to handle stuff like that.
cosimone has joined #lisp
frgo has quit [Remote host closed the connection]
frgo has joined #lisp
frgo has quit [Ping timeout: 246 seconds]
rumbler3_ has joined #lisp
rumbler3_ has quit [Ping timeout: 258 seconds]
jxy has quit [Quit: leaving]
rippa has joined #lisp
Marlin1113 has left #lisp [#lisp]
chris4197 has quit [Remote host closed the connection]
varjag has joined #lisp
Lycurgus has joined #lisp
varjag has quit [Ping timeout: 248 seconds]
shka_ has joined #lisp
scymtym has joined #lisp
orivej has quit [Ping timeout: 272 seconds]
pygmypuppy has joined #lisp
rumbler3_ has joined #lisp
manualcrank has joined #lisp
keep_learning has quit [Quit: Ping timeout (120 seconds)]
rumbler3_ has quit [Ping timeout: 258 seconds]
uint has quit [Quit: leaving]
v88m has joined #lisp
nanoz has joined #lisp
iskander has quit [Quit: Quit]
jxy has joined #lisp
iskander has joined #lisp
slyrus__ has joined #lisp
hhdave_ has quit [Quit: hhdave_]
slyrus_ has quit [Ping timeout: 268 seconds]
anewuser has quit [Quit: anewuser]
Arcaelyx has joined #lisp
pankajgodbole has joined #lisp
ggole has quit [Quit: Leaving]
ym555 has joined #lisp
sz0 has quit [Quit: Connection closed for inactivity]
orivej has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
igemnace has quit [Read error: Connection reset by peer]
Arcaelyx_ has joined #lisp
Arcaelyx_ has quit [Read error: Connection reset by peer]
m00natic has quit [Remote host closed the connection]
igemnace has joined #lisp
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
FennecCode has joined #lisp
notzmv has quit [Remote host closed the connection]
Arcaelyx has joined #lisp
Arcaelyx has quit [Read error: Connection reset by peer]
cosimone has quit [Quit: WeeChat 2.4]
alexanderbarbosa has joined #lisp
Arcaelyx has joined #lisp
drewc has joined #lisp
rumbler3_ has joined #lisp
rumbler3_ has quit [Ping timeout: 244 seconds]
notzmv has joined #lisp
pankajgodbole has quit [Ping timeout: 245 seconds]
t58 has quit [Quit: Leaving]
kajo has quit [Ping timeout: 264 seconds]
kajo has joined #lisp
carmack has joined #lisp
chris4197 has joined #lisp
random-nick has quit [Ping timeout: 258 seconds]
ym555_ has joined #lisp
ym555 has quit [Ping timeout: 248 seconds]
chris4197100 has joined #lisp
chris4197 has quit [Remote host closed the connection]
chris4197100 is now known as chris4197
pfdietz has quit [Remote host closed the connection]
lucasb has quit [Quit: Connection closed for inactivity]
varjag has joined #lisp
bexx has joined #lisp
<bexx> I'm building an interpreter of lisp in lisp
<bexx> for an assignment
<bexx> everything is going fine but then I need to implement recursive functions
<bexx> and I don't know how
<bexx> anyone know a resource on this?
<bexx> pdf, webpage, book, anything
cosimone has joined #lisp
dialectic has joined #lisp
<Bike> you mean like a local recursive function? because if it's globally defined you can just treat a recursive call like any other call to a global function
<bexx> yeah it's a lisp-1
<Bike> that's not what i asked
<chris4197> https://www.youtube.com/watch?v=X5OQBMGpaTU AFAIR this one is pretty good.
<bexx> so I pass to my eval function a list with the expression and a list with the env
<chris4197> Not 100% sure it is the right video.
<bexx> thanks chris4197 !
<chris4197> Oh, nvm. That one seems to be in JS.
<chris4197> My apologies.
<Bike> you can implement letrec as basically binding the variables to some kind of unbound marker, evaluating the forms in that environment, then modifying the environment to have the values of the forms for those variables.
varjag has quit [Ping timeout: 245 seconds]
<dialectic> it doesn't have to be a destructive operation on the environment
<Bike> like (letrec ((x y)) ...) = (let* ((x #<unbound>) (z y)) (setq x z) ...)
<Bike> you could also use a fixed point combinator
<chris4197> THAT was the video I thought of. Sadly it is in clojure. https://www.youtube.com/watch?v=2wPS_6oSD6k
<chris4197> And I was wrong again. I am way too tired.
<chris4197> https://www.youtube.com/watch?v=OyfBQmvr2Hc This should be the one. Final try.
<bexx> hahaha
<bexx> thanks chris!
random-nick has joined #lisp
Bike has quit [Remote host closed the connection]
Bike has joined #lisp
pfdietz has joined #lisp
Lycurgus has quit [Quit: Exeunt]
stacksmith has joined #lisp
cosimone has quit [Quit: WeeChat 2.4]
rpg has joined #lisp
amerlyq has quit [Quit: amerlyq]
varjag has joined #lisp
bgardner has left #lisp [#lisp]
slyrus_ has joined #lisp
slyrus__ has quit [Ping timeout: 272 seconds]
nanoz has quit [Ping timeout: 248 seconds]
dxtr has quit [Ping timeout: 272 seconds]
dxtr has joined #lisp
Inline has quit [Quit: Leaving]
vlatkoB has quit [Remote host closed the connection]
rumbler31 has joined #lisp
saravia has quit [Ping timeout: 246 seconds]
Bike has quit [Remote host closed the connection]
Bike has joined #lisp
rumbler31 has quit [Ping timeout: 244 seconds]
mathrick has quit [Ping timeout: 276 seconds]
chris4197 has quit [Remote host closed the connection]
nonlinear is now known as wish
Fare has joined #lisp
wish is now known as wishek
cosimone has joined #lisp
mathrick has joined #lisp
wishek is now known as nonlinear
scymtym has quit [Ping timeout: 252 seconds]
slyrus__ has joined #lisp
slyrus_ has quit [Ping timeout: 245 seconds]
shka_ has quit [Ping timeout: 246 seconds]
varjag has quit [Ping timeout: 258 seconds]
varjag has joined #lisp
varjag has quit [Ping timeout: 245 seconds]
<Xach> well I've got a pickle of a problem on my hands!
ym555 has joined #lisp
ym555_ has quit [Ping timeout: 258 seconds]
mindCrime has quit [Ping timeout: 258 seconds]
cosimone has quit [Quit: WeeChat 2.4]
szmer has quit [Ping timeout: 245 seconds]
asdf_asdf_asdf has joined #lisp
<asdf_asdf_asdf> Hi. Why my script in Common Lisp return non-zero exit code status?
<asdf_asdf_asdf> How it check/
<asdf_asdf_asdf> ?
<Xach> asdf_asdf_asdf: exiting is not standard. what implementation are you using?
<asdf_asdf_asdf> SBCL.
hello80493485039 has joined #lisp
<Xach> asdf_asdf_asdf: with what code does it exit?
<Bike> i think in disable-debugger mode, an unhandled condition will result in nonzero code
<asdf_asdf_asdf> Xach, I don't know in which code, I want check it.
<Xach> asdf_asdf_asdf: how do you know it is not zero?
<hello80493485039> trying to implement a function similar to "positions" that takes in a number N and a list L and returns all the indices of N in L
<hello80493485039> can someone please debug my function? thanks ^_^
<asdf_asdf_asdf> Xach, I solve tasks from web online.
<Bike> hello80493485039: append does not have side effects like you seem to think, and it works with lists generally. maybe you want push.
<Bike> clhs push
<Bike> asdf_asdf_asdf:try it on a local machine?
<asdf_asdf_asdf> How check code status?
<hello80493485039> I am a CL noob so please guide me the correct way of doing this^
<hello80493485039> thanks Bike
<hello80493485039> whhat is the lisp way of finding the indices of all N in a list e.g. suppose n = 2, list = (2 3 1 4 2) then result = (0 4)
<Bike> there's no built in function for it.
vutral has joined #lisp
<hello80493485039> i dont want to use built in function
<Bike> there are innumerable ways to write it yourself, of course. your code seems like it will be reasonable once it's fixed up
<Xach> hello80493485039: using loop and collect
<Bike> i personally would do (loop for i from 0 for element in list when (eql element to-find) collect i)
<dialectic> (loop for item in list for i from 0 when ... grrr ok bike, steal all the thunder.
<hello80493485039> interesting
<hello80493485039> i was thinking in a recursive manner
<Xach> hello80493485039: in common lisp we think in all manner of manners
<Bike> your way is basically equivalent, of course
<dialectic> (in Stallman's voice) tail recursion is just a party trick
<Bike> with tail recursion it adds up to about the same, except of course yours collects backwards
<Xach> I am befouled with submodules and case-insensitive filesystems.
<hello80493485039> let me read up on how collect works
<dialectic> !clhs loop
<dialectic> no one taught me how to use minion.
<Bike> clhs loop
<Fare> exiting is standard using uiop
<Bike> don't need to use that expensive 'exclamation point' frippery
<Fare> s/standard/portable/
<dialectic> Xach: which filesystem is case insensitive?
<Fare> asdf_asdf_asdf, use uiop to exit with a code, or run-program to run a program and check its exit code.
<Fare> dialectic, many filesystems on Windows and macOS.
saravia has joined #lisp
chipolux has quit [Quit: chipolux]
chipolux has joined #lisp
<hello80493485039> Bike what do u think about this? https://gist.github.com/aamirsahmad/c9af6e26e166ece00f23d946d66b3670
chipolux has quit [Client Quit]
chipolux has joined #lisp
<Bike> list indices start at 0, not 1. using = means the list can only have numbers. using nth each iteration is less efficient than iterating over the elements simultaneously.
<Bike> brb
Bike has quit [Quit: Bike]
techquila has quit [Remote host closed the connection]
techquila has joined #lisp
<dialectic> hello80493485039: https://rentry.co/co446
<dialectic> oops. That should say "for element in list"
rumbler31 has joined #lisp
sjl has quit [Quit: WeeChat 2.3-dev]
<dialectic> Also my recursive version never terminates because I forgot to take the cdr of the list. Loop spoiled me.
sjl has joined #lisp
<hello80493485039> nice dialectic!
<hello80493485039> i like ur loop soln
<hello80493485039> its very straightforward and simple
<dialectic> The only thing I ever use tail recursion for is statemachines, and even then, 90% of the state machines I have ever written are TAGBODY and GO
zotan has quit [Ping timeout: 252 seconds]
gxt has quit [Ping timeout: 260 seconds]
rumbler31 has quit [Ping timeout: 244 seconds]
gxt has joined #lisp
<hello80493485039> dialectic how long have u been writing lisp?
<dialectic> Can't remember if it was late 2011 or early 2012.
<hello80493485039> how did u learn when u were starting?
<dialectic> Practical Common Lisp
<dialectic> (the book).
zotan has joined #lisp
<asdf_asdf_asdf> Fare, very thanks. I compiled to .exe and code exit status is 0.
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<hello80493485039> I am also following that. Its only been a few weeks lol
<dialectic> Using recursion is a pedagogical thing. It is somewhat instructive, maybe even enlightening, but a real language for looping is much better for real use.
<random-nick> does standard common lisp have anything like unix's select?
hello80493485039 has left #lisp [#lisp]
hello80493485039 has joined #lisp
<Fare> asdf_asdf_asdf, you can use asdf or cl-launch to create executables, portably.
orivej has quit [Ping timeout: 272 seconds]
saravia has quit [Quit: Leaving]
Bike has joined #lisp
igemnace has quit [Read error: Connection reset by peer]
Fare has quit [Ping timeout: 272 seconds]
<markasoftware> i'm not sure about that, i tend to find that as a loop gets more complex, it actually gets easier to implement with recursion and more difficult to keep as a loop
random-nick has quit [Ping timeout: 246 seconds]
igemnace has joined #lisp
quazimodo has quit [Ping timeout: 245 seconds]
smazga has quit [Quit: leaving]
<edgar-rft> Stupidly I can't remember where i read the following sentence: "Loop was designed to provide simple solutions for simple problems. As soon as things become more complex it's most often easier to implement solution in more complex code."
asdf_asdf_asdf has quit [Remote host closed the connection]
ltriant has joined #lisp
wxie has joined #lisp
dialectic has quit [Ping timeout: 245 seconds]
Fare has joined #lisp
dialectic has joined #lisp
krid has joined #lisp
rumbler31 has joined #lisp
Fare has quit [Ping timeout: 248 seconds]
Oladon has joined #lisp
wxie has quit [Quit: wxie]
ebrasca has quit [Read error: Connection reset by peer]
rpg has quit [Quit: Textual IRC Client: www.textualapp.com]
seok has joined #lisp
<seok> Thanks Bike and PJB I fixed the code, works with a function I had missed a parantheses
<seok> haha
<no-defun-allowed> random-nick: (remove-if-not #'listen streams) -> streams-ready-to-be-read-from