freenode/#lisp - IRC Chatlog
Search
22:21:08
comborico1611
I am trying to run STEP on a compiled file specifically to avoid the weird inner workings of the REPL. But I'm still getting those inner workings printing from STEP.
22:25:58
moldybits
`Lock on package COMMON-LISP violated when globally declaring SPEED SPECIAL while in package COMMON-LISP-USER.'
22:27:12
jasom
moldybits: you shouldn't use CL:SPEED as a function or variable name, no. In addition, you also probably shouldn't have any special variables without *earmuffs*
22:30:02
_death
moldybits: if you defined a function named cl:speed and someone else did too, there would be a problem..
22:30:14
pjb
moldybits: (defpackage "ANIMALS" (:use "CL") (:shadow "SPEED") (:export "SPEED")) (defun animals:speed (snake) 42)
22:30:58
specbot
Constraints on the COMMON-LISP Package for Conforming Programs: http://www.lispworks.com/reference/HyperSpec/Body/11_abab.htm
22:31:13
moldybits
okay, so it can be done. but is it considered good style to do so, as opposed to naming it velocity instead?
22:31:50
jasom
moldybits: If you plan on exporting it, it's up for debate on how wise it is; using it internally is 100% fine IMO
22:32:23
pjb
moldybits: if you shadow it, then users using your package will have to use shadowing-import-from to choose the symbol they will import.
22:33:05
jasom
It makes it harder for other packages to :use your package; that's pretty much the only downside.
22:33:19
pjb
(defpackage "JUNGLE" (:use "CL" "ANIMALS") (:shadowing-import-from "ANIMALS" "SPEED")) …
22:34:06
pjb
so animal-walking-speed animal-running-speed animal-swimming-speed animal-climbing-speed might be better names.
22:34:20
no-defun-allowed
(defgeneric Δs/Δt (animal) (:documentation "The (maximum) change in displacement over change in time for this animal"))
22:34:37
jasom
uiop:define-package has a shortcut for this I think (prefers the first package with the symbol found).
22:35:51
jasom
prefixing accessors with the class name is relatively common in CL; it makes some sense both because of the limitations on arity of generic functions and the near lack of types in CL.
1:36:45
drmeister
clpython implements closer-mop:validate-superclass but clasp's defclass and validate-superclass doesn't know anything about it.
1:42:36
verisimilitude
Well, I have a network solution that works just how I want it to, now. I run netcat as the listening process and simply read from its stdout and write to its stdin. It's easier than using USOCKET.
1:55:46
verisimilitude
Here's what I had as a test; they get a period and newline and I get whatever was sent:
1:55:46
verisimilitude
(with-input-from-string (*standard-input* (format nil ".~c~c" (code-char 13) (code-char 10)))
1:55:46
verisimilitude
(sb-ext:run-program "netcat" '("-l" "-q" "0" "-p" "1025") :input *standard-input* :output *standard-output* :search t))
1:57:23
verisimilitude
This is more than good enough for a simple Gopher server, until I write a proper network abstraction library.
1:59:27
verisimilitude
A Gopher server is going to get far less than one request per second, so this is fine for now.
2:02:59
verisimilitude
No; in actuality, it's going to be reading the input and using it to determine what's returned.
2:04:57
verisimilitude
It just launches the program, with the arguments, with stdin and stdout attached to whatever you want.
2:05:01
gilberth
There is :WAIT NIL or something. I believe you actually then get streams to talk "interactively" to the unix process.
2:08:16
verisimilitude
I was going to write this Gopher server to be indifferent to how its streams are connected, so that will be sufficient for now.
2:09:12
gilberth
Well, I would bite the bullet and figure out the USOCKET API. You need to write the accept loop only once.
2:09:57
gilberth
But, if this is kind of one-shot you are trying to do and have a low chance of two connection requests at once, it'll do.
2:11:12
gilberth
verisimilitude: Well, inetd would spawn a new [unix] process altogether for each connection.
2:11:53
verisimilitude
I understand enough to know I don't care for the complicated BSD Sockets API, which USOCKET abstracts with, so my sense of aesthetics compels me to write my own solution, gilberth.
2:12:16
Josh_2
gilberth: here is some prototype but functional server and connection if it helps https://plaster.tymoon.eu/view/1264#1264
2:13:10
gilberth
verisimilitude: I understand that. IMHO using inetd or netcat is not particular simpler.
2:13:18
Josh_2
unwind-protect is a life saver with usocket xD otherwise you will get address in use over and over and over
2:14:19
verisimilitude
As for running it in a way that connects these streams to the Internet, xinetd will be more than good for now until I have a network library in Common Lisp I want.
2:15:24
gilberth
Well, you could evolve that. Do with a netcat loop to develop it, then later use USOCKET. But again: I would bite the bullet.
2:17:26
gilberth
If you could live with either the latency of using inetd or the fact, that clients might get a connection refused [netcat loop], fine.
2:17:35
verisimilitude
I don't like USOCKET, from what I've seen, so I'll just write my own library; Common Lisp makes it easy to do this.
2:19:15
verisimilitude
The library would work over streams, ideally, so it would be easily interchangeable.
3:04:11
gilberth
eschatologist: We have bad luck. I found hermes, but that is a data transmission method to transmit data voice modulated over GSM channels.
3:22:09
gilberth
eschatologist: http://bauhh.dyndns.org:8000/flux/boggle.lisp this is the kind of code quality you will face.
3:24:41
eschatologist
Yeah, it's fairly clever, just keeping a placeholder object in the group list.
3:30:25
loke
gilberth: am I misreading the code, or is that code never restoring the syntax to #\, ?
3:32:00
loke
No. and the restoring of the syntax of #\- should probably be done in an unwind-protect
3:32:28
drmeister
Does anyone know how closer-mop brings a system closer to mop? Does it make their existing clos work closer to mop or does one have to use closer-mop symbols?
3:33:17
loke
drmeister: most symbols are just re-exported into the closer-mop package. In some cases there are workarounds written for some lisps
3:34:47
drmeister
So - clasp's defclass invokes clasp's clos::validate-superclass. I'm trying to build clpython and it defines some methods on closer-mop:validate-superclass but they appear to be ignored - is there anything I need to do to integrate these closer-mop:validate-superclass into clasp's clos?
3:36:33
loke
drmeister: SOunds like a problem with closer-mop. Closer-mop should be reexporting the validate-superclass into the closer-mop package
3:37:52
drmeister
Hmm, I think I see. If closer-mop reexports clos:validate-superclass then defining methods on closer-mop:validate-superclass means they are methods on clos:validate-superclass.
3:41:30
djeis[m]
Comments in the source suggest that the closer-mop dev has assumed clasp's mop is more or less ecl's and if I'm reading the defpackage correctly it's importing (and re-exporting) validate-superclass from clasp's clos package.
4:02:36
drmeister
I think this uncovered a subtle problem with clasp's generic function dispatching.
8:38:24
scymtym
svillemot: this is not a problem or anything, but i was wondering whether there is a particular reason for Debian not upgrading to SBCL 1.5.0 in unstable. put differently: did we do something problematic or worrying in SBCL?
8:39:15
svillemot
scymtym: this is because Debian is currently in freeze, in preparation for the next release (“Buster” 10), probably for a couple of months