freenode/#lisp - IRC Chatlog
Search
17:35:11
krwq
+ in most of the cases I'll likely wrap the codegen anyway and can add a simple testcase/assert
17:40:52
krwq
pjb: I wanted to add just <ul><li><a href="foo">bar</a></li>...</ul> - I did text gen first but it started getting ugly and I'm planning to add more complex html later
18:17:11
HighMemoryDaemon
I have a pathnames package defined in another file. When I use Slime and try to compile, I get the error "The name "PATHNAMES" does not designate any package." However, when if I compile that load line separately and then compile the file, it works fine. My basic code: https://hastebin.com/duzaxajimi.lisp
18:18:21
Xach
HighMemoryDaemon: better: define a system file and let asdf load things in the right order for hou
18:24:33
Xach
like, you could have something like myproject.asd containing: (defsystem #:myproject :serial t :components ((:file "pathname") (:file "spam-filter"))) and then use (asdf:load-system "myproject") will compile and load them in order of appearance
18:26:26
HighMemoryDaemon
That is pretty easy. Was just checking out this guide: https://common-lisp.net/~mmommer/asdf-howto.shtml
18:28:19
Xach
HighMemoryDaemon: oh, here's something i made to help get started with stuff that requires other libraries: https://www.xach.com/tmp/quickstart.html
21:15:09
dim
Xach: BTW there's now https://github.com/slyrus/abcl/tree/master/contrib/asdf-jar (which I'm yet to try), so that might be something for you to have a look at in the context of quicklisp bundles when using ABCL?
21:39:54
mood
The most confusing thing when writing macros must be double backquotes. I just don't have any intuition for them
21:41:59
mood
pjb: I'm writing a macro-defining macro, and using list, append and friends would obscure just how simple what's happening actually is. Except for the fact that double backquotes are even more confusing, so I guess I'll just do that.
21:42:37
pjb
macros are functions like any other, don't forget to use abstractions and factorization.
21:42:41
mood
AeroNotix: Sure, but when you're two levels deep, how do you get back to the outer level? ,, produces all kinds of weird effects
21:49:48
mood
Shinmera: That does work, but I don't *understand* it. My brain wants to just write ,,(when has-thing '(print "bar"))
21:50:23
Shinmera
Well first you need the ,@ in order to splice in a list that won't leave a NIL if your test is false
21:50:48
Shinmera
Then, since you don't want the code to be evaluated when the inner macro is called, you need the quote
21:51:50
Shinmera
Basically since each level of unquoting is going to try to evaluate the thing, you need to stop that from happening by intermittently adding quotes.
21:51:52
AeroNotix
But pjb is right, probably could turn the inner-macro into a function that returns that form
21:56:40
mood
AeroNotix: I could generate the body of the inner macro using a function, yes. I'll see if that makes things clearer
22:03:01
equwal
Paul Graham has an interesting take on double quoted macros in On Lisp. He compares them to integrating (something you do in calculus). Essentially the reason it is difficult isn't because of the notation, it is because it is just a really complex problem. Just like integration though, there are tricks you can learn to make it easier. For example, when writing a macro-writing macro, you can write the inner macro separately, then write
22:03:01
equwal
the outer macro into it. You can then substitute in the code for the inner macro. The analogy is strong: substitution is one method of integration. There are other tricks you learn as you go along.
22:11:17
mood
Shinmera: It looks quite alright in the logs: https://irclog.tymoon.eu/freenode/%23lisp?around=1534111681#1534111681
22:15:57
no-defun-allowed
should i still put #' before my lambda expressions? sbcl doesn't seem to care and it feels old
22:16:47
mood
no-defun-allowed: There is a macro named LAMBDA that expands to #'(lambda ...), so you don't have to, except in some circumstances
22:18:21
Shinmera
mood: Funnily enough #'(lambda ..) also doesn't work in some situations, like the :report of a condition.
22:18:47
Shinmera
In fact, in which situation do you think you have to add #', because I can't think of one
22:19:54
mood
Hmm, good question. I seem to remember finding something in the past, but I'm drawing a blank
22:20:12
Shinmera
Anyway, the short is: save yourself the two characters and the visual noise, and just use lambda.
23:05:27
pjb
aeth: #+genera (defmacro lambda ((&rest bindings) &body body) `(cl:function (cl:lambda ,bindings ,@body)))
23:15:34
aeth
pjb: I think it was Genera. I'm not sure because it has been a few years. I think the proper way of doing it, though, is pushing it to *features* iirc.
1:04:00
slyrus1
scymtym: if you've got a moment, can you take a look at https://github.com/sharplispers/closure-common/pull/2 ? thanks!
3:12:30
kenster
Streaming some epic lisp and C++ programming: https://youtu.be/lEL0Nly2CE0 or https://www.twitch.tv/kingherring
3:13:27
asarch
If I have a git directory, how could I know the full address of it on the GitHub server?
3:14:00
Colleen
Bike: karlosz said 20 hours, 59 minutes ago: I found a possible cause. Code like this (let ((*x* (or ... ...)))) can introduce a lexical location that is defined in two branches. Thus, we have our no dominating definer case we were looking for. I generalized the code to handle placing it in the lowest common ancestor node in the dominance tree.
3:14:01
Colleen
Bike: karlosz said 20 hours, 57 minutes ago: i meant that the let can introduce a lexical location which can be captured and has no dominating definer.
3:39:33
ym
There is a paper by Jogn Alan McDonald called "Object-oriented programming for linear algebra." and dated July 10, 1989. It tells about "a system for numerical linear algebra and optimization, implemented in Common Lisp[l3] and CLOS[l], called Cactus.". Cannot google this Cactus system location in the Internets.
3:41:44
asarch
One stupid question, does Scheme have an ANSI standard just like Common Lisp has (ANSI X3J13)?
3:53:13
beach
asarch: There are several standards organizations in the world. Each country typically has at least one. Then you have IEEE, ISO, ECMA, etc.
3:56:26
beach
asarch: It is important to understand that a standards organization is not necessarily appointed by anyone in particular. It can be an association, or it can be a for-profit company. The important role of a standards organization, as far as programming languages are concerned, is that it is independent of the organizations that provide the implementations.
4:05:50
beach
Sure. It's an important concept that is, unfortunately, often unknown to software developers. In fact, it is often unknown even to project leaders whose task it is to choose a programming language. The result is that they often choose programming languages that do not have an independent standard, with potentially dire consequences to the projects they are leaders of.
4:08:13
drmeister
If an array of unsigned byte8's only contains values between 0x01 and 0x7f inclusive - then it can be stored in a simple-base-string - correct?
4:10:44
drmeister
I thought that might be the answer - so I asked. What about printable ascii characters? 0x20 to 0x7f?
4:12:51
drmeister
Right - it says nothing about the encoding of characters. I need to decide if an array of bytes can be coerced into a simple-base-string.
4:13:52
drmeister
I could coerce those to arrays of bytes - I was looking for some other way of testing rather than failing utf-8 encoding.
4:14:08
White_Flame
" Whether a character is a base character depends on the way that an implementation represents strings, and not any other properties of the implementation or the host operating system."
4:14:27
beach
As far as I know, a UTF-8 string with bytes only between 0 and 127 contains only ASCII characters.
4:15:16
drmeister
I'm working on code that receives messages from the pzmq library - they are foreign-data. The foreign-data is being run through: (cffi:foreign-string-to-lisp (pzmq:msg-data msg) :count (pzmq:msg-size msg) :encoding cffi:*default-foreign-encoding*) - occasionally it fails.
4:15:46
beach
drmeister: I don't understand why you need to coerce an array of bytes into an array of bytes.
4:16:36
drmeister
I need to coerce the foreign data into strings when they can be and coerce them into arrays of bytes when they cannot be.
4:19:09
drmeister
When the cl-jupyter library reads a message using the pzmq library the message contains a part called the identity followed by the message.
4:19:54
drmeister
The very first message that is read has a pzmq supplied identity - which is a 5-byte array. Every other identity is a text uuid.
4:20:36
drmeister
The cl-jupyter library doesn't seem to be aware of this and tries to coerce every part of every message (including identities) into simple-base-string's
4:22:14
drmeister
I believe that the only reason the cl-jupyter library has worked for the last two years is some fluke of the communication protocol that allows it to sync up with the server after many failed messages have gone back and forth. I believe it all comes down to this 5 byte array.
4:23:10
drmeister
So - to deal with it - I need to recognize when a foreign-data array of bytes can not be encoded as a simple-base-string and in that situation - encode it as an array of bytes.
4:24:08
drmeister
I think I will apply the #'graphic-char-p predicate to every byte - and if they all pass - then I will convert it to a simple-base-string.
4:26:09
White_Flame
isn't this just a simple state machine, where the first message is binary and the rest are text?
4:27:33
drmeister
The first part of the first message is binary and all parts after that are text - as far as I understand.
4:28:58
drmeister
I'm not sure what I said is correct - I'm not sure if the identity should be considered part of the message.
4:29:28
drmeister
I'm still feeling my way around here. What I have figured out is if you treat all parts of all messages as strings - there is trouble.