freenode/#lisp - IRC Chatlog
Search
9:36:18
theothornhill
I mailed Kent Pitman about the dpANS to see if he knows the status with regards to copyrights for the hyperspec and the dpans. Hopefully he knows something about it and is willing to share
9:39:06
theothornhill
beach: as for the document, how do you envision I handle the macros? I can expand everything now using this perl script, but I lose a lot of semantics doing that
9:39:54
theothornhill
I think it might be better to expand all the "\input foo" and concatenate everything and use the macros as parsable items
9:40:26
beach
We could also contact ANSI. They do not seem to make any money from this particular standard.
9:40:52
theothornhill
Now it is simple to grab the two \displaythree{Foo}{Bar}, rather than 75 lines of tex primitives
11:52:17
phoe
"We, as a community, expect to continue to own the spec." is the particular quote I am interested in
11:52:45
phoe
in this context, I can infer that the specification is public domain but a standard that's based on it to the point of being identical is ANSI-copyrighted
11:54:50
phoe
and ANSI copyrights the fact that it has "the standard", along with the graphical rendition of it
12:03:01
no-defun-allowed
Thankyou for taking a bot to #lisp. Though if it makes okay output on IRC it'd be nice.
12:03:49
no-defun-allowed
Okay, so the bot says nothing on IRC and Mrtn Dk looks like they are talking to the wind.
12:04:19
phoe
no-defun-allowed: I actually can't see the bot output in the tymoon log, which is decent
12:06:39
no-defun-allowed
Does that bother you? Don't read it as if I'm saying it should, I'm just wondering.
12:07:59
no-defun-allowed
Suppose saying "nice" suggests it doesn't. I'll be more awake in 46 hours surely.
12:10:16
phoe
if it was used multiple times a day it probably would but it's the first time I ever saw it here, so nah
12:13:25
_death
even if there are other means of rate control, it's just clutter and I'll likely /ignore it
12:24:16
MrtnDk[m]
I guess if an @ on IRC side kicks the bot, it will be kicked on the matrix side as well. fe[nl]ix
12:33:34
jeosol
phoe: I realized you are one of the contributors listed on cl:yesql. Is it possible to somehow issue multiple commands, e.g., a create extension command, then a CREATE table command, and possible an index later on. See this paste: https://pastebin.ubuntu.com/p/BZfhCVMGMC/
12:34:13
jeosol
So far, i get errors that "cannot insert multipe commands into a prepared statement".
12:35:35
jeosol
I am doing small tests, the issues i sometimes get with ORM's makes me want to explore the alternative and write the sql queries. So I started looking at alternatives
12:36:17
phoe
jeosol: https://stackoverflow.com/questions/19589841/pg-prepare-cannot-insert-multiple-commands-into-a-prepared-statement
12:36:59
jeosol
Thanks. for clearning that up. When I split the command into separate function calls, it works. Closed
12:39:03
phoe
it's a really really nice wrapper that allows me to treat SQL statements as Lisp functions
12:39:32
phoe
and it just works™ - I only had trouble with the initial setup and overlord/vernacular when combo'd with some EVAL-ALWAYS situations, but afterwards, it works
12:39:56
jeosol
I am no postmodern or mito expert, but sometimes, the lack of transparency and need for more complex operations, I start having problems
12:40:41
jeosol
I understand SQL more so using the queries directly seems to present less issues. And then you get the statement as functions.
12:42:34
jeosol
I haven't been here much; have some abstracts that are due and trying to finish some of the work; crazy days
12:43:17
phoe
things are looking good for the latter and not very good for the former, but that's business as usual
12:44:05
jeosol
Regarding ELS, do you guys accept paper about application, e.g., describing the use of CL to build an application?
12:45:08
jeosol
great work by the way. I'll get to support you guys soon. My task is coming to an end, once I get the web thingy going
12:47:00
jeosol
I'll like to contribute something along those lines. I know it's closed for this year
12:47:06
heisig
jeosol: Yes, ELS accepts both classical academic papers of up to eight pages, and software demonstrations of up to four pages.
13:22:36
seok
When I run the same piece of code on a linux machine on the same network it's blazingly fast, no problem
14:14:02
loke[m]
(disassemble #'(lambda (x) (tagbody a (print 1) (go c) b (print 2) (go d) c (print 3) (go b) d (print 4))))
14:14:42
loke[m]
All I can tell from that is that there seems to be nothing special about TAGBODY. You'll have to come up with an example we can run so we have something to analyse.
14:19:02
loke[m]
lotuseater: Well, if that thing is bigger than you expect, it's not because of TAGBODy
14:19:22
loke[m]
If you want to optimise it, the first thing you need to do is add type declarations.
14:20:17
loke[m]
Am I missing something by the way? L2, L3 and L4 don't seem to be used. This is just an infinite loop, no?
14:20:40
lotuseater
yes loke[m], i will, but first it should work correctly and 1:1 as the algorithm is given
14:25:34
lotuseater
it's basically this (one page): https://trash.randomerror.de/ev4tw/algorithm-k.pdf
14:25:57
beach
Like for instance: (let (... perms) ...) means "I am not initializing perms explicitly because I intend to assign to it before it is used" But then you use it before you assign to it.
14:26:58
beach
And (= j 0) is better expressed as (zerop j). There is a general rule in programming that you should use the most specific construct that will do the work.
14:27:35
beach
lotuseater: Semantically, it's an empty list, but it is not an empty list in the message that you send to the person reading your code.
14:53:18
dieggsy
beach: wait, so what's the difference between (let ((this) ...) ...) and (let (this ...) ...))
14:55:58
dieggsy
lotuseater: the former is actually what i use lol, only because i didn't realize (let (this ...) ...) is alllowed
14:57:00
TMA
beach: I have written a (part of a) compiler, I am prone to dismiss differences that have no effect on the resulting code.
14:57:27
lotuseater
but with this now I even once more get the feeling I can become at anything and that makes me sad, but it's too offtopic
14:58:33
vms14
I suppose the way is to write minimal stuff in the "host language" and much as possible in your lisp implementation
15:00:04
beach
vms14: Is ABCL written in Java? I am asking because there is no particular reason to do that.
15:00:05
TMA
beach: I am my own maintainer, mostly (the rest of my work no longer maintained). But I do have rather strong style preferences. I just resigned trying to enforce them on others or explaining them.
15:00:45
beach
TMA: I see. I find that even if I am the maintainer of my own code, I have to be very disciplined, or else I won't forget it some weeks later.
15:01:05
minion
dieggsy: SICL: SICL is a (perhaps futile) attempt to re-implement Common Lisp from scratch, hopefully using improved programming and bootstrapping techniques. See https://github.com/robert-strandh/SICL
15:01:10
minion
dieggsy: Cleavir: A project to create an implementation-independent compilation framework for Common Lisp. Currently Cleavir is part of SICL, but that might change in the future
15:01:56
beach
vms14: There is no particular reason to use any "host language" at all, as the SICL bootstrapping technique shows.
15:03:18
TMA
beach: I do have quite consistent style, I think. I use it when not under undue time pressure. In the other case anything goes. It makes me sad, though less sad than missed deadline.
15:03:37
vms14
my technique is to use s7 scheme, which is a .h and a .c file and you can just add your own stuff in it, but it's scheme not cl, which meh. I really prefer cl, I guess just because it's the lisp I used
15:04:04
beach
dieggsy: The compiler framework is in use production in Clasp, and the SICL compiler is of course based on it too.
15:05:23
beach
dieggsy: Oh, and I should add that, even though I started it, Bike and karlosz have done a lot of work on Cleavir lately.
15:06:49
beach
vms14: So it is hard to write a Common Lisp compiler, but it is an order of magnitude harder to write an implementation-independent compiler framework. :)
15:08:33
lotuseater
ACTION has high respect for things like that and asks how he can ever catch up to this expertise
15:09:26
beach
lotuseater: It has taken me the better part of a lifetime, because I am not particularly smart; just stubborn.
15:38:27
ecraven
thanks for pointing out cl-yesql, this finally seems like a sane approach to "sql as a dsl"
15:57:04
engblom
When building up a plist, is it ok to first push value and then push key? Or could I push both at the same time?
16:00:17
engblom
nij: It will be something like (:key1 :value1 :key2 :value2 :key3 :value3 ...) and I will begin with an empty list, and then adding one pair at the time
16:00:49
beach
engblom: You can push the value and then the key, provided you don't use the list between the two operations.
16:01:34
engblom
beach: Thanks, then I will do so. I am just asking if it is OK, as I am still very new to lisp and somtimes there are better ways to do things that what I know about.
16:03:16
nij
There are many ways. At the end just make sure you get something you want. Then it's ok.
16:03:45
nij
But I've heard someone saying it's better to only use plist operations.. aka we should live on top of the abstraction..
16:04:35
nij
minion, tell theothornhill that I've read the log and am glad to know if there's any news back from the people you mail.
16:04:42
vms14
pjb: recommended me to use defstruct over plist, I've just obeyed without no reasoning about
16:06:06
vms14
;; Those structures will go on the lists ;; pjb recommended me to use defstruct ;; instead of property values of symbols ;; 2020-04-13
16:06:13
engblom
beach: I tested it. I did not know you can use (setf (getf plist :key) "foo") when :key do not exist yet, but it does what I want
16:08:21
nij
I remember there's a CL system that allows you to get access to a specific place of a highly nested object easily.. is it called accessor?
16:09:31
nij
minion: memo for theothornhill: I've read the log and am glad to know if there's any news back from the people you mail.
16:12:51
nij
ebrasca: if it's enough stumpwm-like, you should be able to add a config file for it to read at startup
16:14:40
nij
ebrasca: here's a config example for stumpwm that I learned a lot from. Its starting point is init.lisp : https://github.com/alezost/stumpwm-config/blob/master/init.lisp
16:33:31
engblom
Is there something as simple as (dotimes (i 4) ... ), but allowing you to specify the starting point?
16:34:19
Bike
there is not a standard macro like dotimes that lets you specify a starting point. you can use addition or loop though.
16:35:37
nij
http://www.gigamonkeys.com/book/loop-for-black-belts.html engblom search "from" in this page
16:38:23
Bike
you shouldn't modify an iteration variable. also, even if it did work, it might only loop twice - i = 0, then i = 3, then i = 5 so it quits
16:39:36
nij
However, this works: (dotimes (i 6) (let (( i (+ i 3) )) (format t "~a" i))) ;; => 345678
16:43:01
nij
Suppose I'm to hack minion as a toy, for a random user to let it evaluate random codes.. what's a good strategy to blacklist malicious codes?
16:45:37
pjb
engblom: you can use list* to push both at the same time: (list* :new-key 'new-val plist)
16:45:38
_death
whitelist is a better solution.. so you can have a package where only allowed symbols are present
16:48:16
pjb
vms14: there are always exceptions and circumstances. If the set of fields is fixed, it may be better to use structures than plists. If the set of keys is variable and you want to accept keys not known at compilation-time, then plists are better.
16:49:39
pjb
nij: tiling let's you prevent a certain class of cockpit error: the case where something is displayed in a window, but you cannot see it because that window is hidden behind another window.
16:50:01
pjb
nij: therefore tiling is important on control panel applications where you want to be sure that the information is visible to the operator.
16:51:48
semz
Is there a way to get access to an internal function (generally but in CCL is fine too) as an object? DISASSEMBLE will only give me the outer function's code and pulling it out would be rather annoying.
16:52:00
pjb
nij: it's simply not specified how and when the loop variables are bound. Even (let ((fs '())) (dotimes (i 6) (push (lambda () i) fs)) (mapcar (function funcall) fs)) is not conforming. So mutating the variable i is even conforming.
16:55:12
pjb
Instead, you can write either: (let ((fs '())) (let (k) (dotimes (i 6) (setf k i) (push (lambda () k) fs)) (mapcar (function funcall) fs))) #| --> (5 5 5 5 5 5) |#
16:55:12
pjb
or: (let ((fs '())) (dotimes (i 6) (let ((k i)) (push (lambda () k) fs))) (mapcar (function funcall) fs)) #| --> (5 4 3 2 1 0) |#
16:56:52
pjb
and of course, if you want to modify your loop variable: (loop with i = 0 while (< i 10) collect i do (incf i (1+ (random 3)))) #| --> (0 3 5 6 8) |#
17:25:18
theothornhill
beach: So Kent Pitman came back to me, with an enthusiastic reply. Nice! He says that the dpANS is the way to go, and a suit is unlikely. He'd _not_ recommend making a CLHS 2.0, and would rather focus on creating a "WikiSpec" starting from the dpANS, allowing the spec to be alive, without requiring to go through a committee for every typo, not to mention real bigger changes
17:25:19
minion
theothornhill, memo from nij: I've read the log and am glad to know if there's any news back from the people you mail.
17:27:15
theothornhill
nij: I think this sounds smart. We could then start by displaying the spec as it is, then work incrementally on creating a live, documented and annotated spec that caters to more modern needs
17:30:18
theothornhill
(If we allow a feature to disable every annotation we'd avoid the need to go through some uncoordinated committee, since the real, trusted spec is only one click away)
17:31:42
theothornhill
His reply is way too long to post here, so I'll ask him if I could publish some or all of it for posterity.
17:35:45
theothornhill
phoe: I say we try. I'll start work on htmlizing the spec this evening. I also have done some initial work on making the transition from dpANS to something else reproducible, so we don't have to worry about keeping things verbatim, which would be super important as a first step should this work
17:47:43
phoe
tvraman is not capable of seeing, so he wanted a way to translate TeX papers into audio
17:48:05
phoe
and he did that by parsing TeX into Lisp and then serializing Lisp objects into commands sent to a TTS device
17:48:43
phoe
it seems that this code mostly loads and works even on modern lisp implementations, though it needs to get some overall polishing
17:51:54
theothornhill
Pitman also told me to be sure to organize such an effort with other people, to make sure we don't double the work, considering it's a small community
18:47:09
engblom
I did my first try with a macro, but failed: I tried to put both the macro and some kind of explanation of what I want here: https://pastebin.com/snBdwRdE
18:49:22
phoe
engblom: second thing, what do you want the resulting, macroexpanded code to look like?
18:49:25
flip214
second, there are some things missing... some declarations (what is set-on-change?), and the problem you have.
18:50:44
engblom
There is no applicable method for the generic function #<STANDARD-GENERIC-FUNCTION CLOG:VALUE (3)>
18:51:34
engblom
(set-on-change ...) is a function from clog library and service-type is a clog object
18:52:12
engblom
https://rabbibotton.github.io/clog/clog-manual.html#x-28CLOG-3ASET-ON-CHANGE-20GENERIC-FUNCTION-29
18:55:48
_death
engblom: I suggest to replace "defmacro" with "defun" and try to get (custom-set 'set-service-parameters 'p) to result in the form you want
18:58:29
_death
oh, I missed the problem description.. the issue you may have is one discussed today in this channel..
19:00:46
_death
where a binding is changed in a loop.. perhaps an expansion like (let ((p-var p)) (lambda (obj) (declare (ignore obj)) (set-service-parameters p-var))) will work (note that I use "p-var" but in your macro you should generate a symbol each time, say using GENSYM)
19:01:11
engblom
_death: So I have a loop that creates a lot of clog objects, and each clog object needs its own function that should be run when they are changed. In this case the only difference that should be in the function is the argument to set-service-parameters. The p binding is changed in the loop, so I tried to use a macro to generate the function.
19:03:09
_death
well, you can just use a function to generate the function.. you'll pass #'set-service-parameters to it instead
19:04:22
engblom
_death: I do not understand how. The problem is that the clog obj will always be passed to whatever I give (set-on-change ...)
19:08:38
_death
you need a function that takes f and x, and returns a function that takes an obj (and ignores it) and calls f with x
19:19:09
_death
so now you can change the name to a more general name, say ALWAYS and have it take &rest parameters instead of just (f x) or (obj).. or you could call it say ALWAYS-FN and have an ALWAYS macro that expands to `(always-fn (function ,function-name) ,@args)
19:20:18
_death
so that you can write (always (set-service-parameters p)) ;; inner parentheses are stylistic
19:23:26
kiwichap
so like there's certain parts involved like authentication, session, different users
19:25:42
theothornhill
kiwichap: lisp can do that for sure. I guess it depends on what you'd be interested in focusing on. If just getting that app up and running, I'm sure some python, ruby og js frameworks will be quicker
19:26:34
kiwichap
I never did any of them and haven't done all the much programming but I somehow got a degree in it if that makes sense
19:26:55
Xach
Yeah, there are other environments where tasks like that are a matter of filling in some blanks. Common Lisp isn't one of them, mostly.
19:28:06
kiwichap
I did a little bit of Java in school , so much complications there, then I did some php on my own, I did my first cgi scripts and a hello world or 2 in lisp
19:28:29
Shinmera
here's a start then: https://github.com/Shirakumo/radiance-tutorial/blob/master/Part%200.md
19:55:29
rumbler31
phoe: I'm looking at running your ansi-tests branch of ccl. I'd like to reproduce your results. How did you go about building that branch?
19:57:08
phoe
I will be able to help you build that on Thursday or later - right now I'm 100% in ELS-local-chairing mindset
20:03:23
rumbler31
yea I bet. I'm disappointed because I was looking forward to watching it live, but this is the week I have to go into the office and I won't be able to watch
20:14:46
_death
I asked because I never looked at abcl.. but I just cloned it and cloc gives about 60kloc in each language