freenode/#lisp - IRC Chatlog
Search
14:52:38
pjb
with define- you would use in-extenso name, while with def, you can use abbreviations or even puns. What's those UNs we keep DEFining all the time with DEFUN?
15:35:34
nwoob
I apologize if what i'm about to ask has been asked many times and you guys are fed up with these type of question.
15:35:37
nwoob
I want to learn a different paradigm language and I stumbled upon CL and posts and answers saying how great CL is and it has features which todays languages are still catching up to. One must learn lisp to become a good programmer.
15:35:54
nwoob
I want to simply know (if possible) will I learn things that I won’t be able to learn in other languages? Is learning CL still beneficial in 2019
15:37:54
jcowan
nwoob: Definitely. A great many things that have to be laboriously worked around in other languages are already built into Common Lisp, or can easily be implemented. It's called "the programmable programming language" (see the topic line) for a reason.
15:41:48
splittist
nwoob: do, or do not, there is no try. Commit to learning CL on its own terms for period. If it grabs you, great. If it doesn't, you'll have learnt something about yourself and CL. The biggest mistake when learning CL seems to be trying to understand CL concepts in terms of things you already know.
15:42:36
nwoob
it does grab me. I have actually started learning it and i must say i have never enjoyed learning something this much
16:59:55
polezaivsani
Learning ASDF by slogging through manual and best practices, am i missing out on some other good material?
17:46:22
Demosthenex
i've now coded a proof of concept for a CRUD TUI in both npyscreen in python, and tview in go... and i just keep beating myself up for not using lisp. ;] have i missed a tui library for CL?
17:50:21
Demosthenex
there's a big difference between having a screen control lib and having editable widgets
18:02:49
verisimilitude
If you don't want to use Common Lisp linking to C, there's my ACUTE-TERMINAL-CONTROL, Demosthenex.
18:03:24
Demosthenex
i've looked at cl-charms and croatoan, didn't quite fit. verisimilitude yours was just character control again... i didn't want to reinvent the wheel just to update a tiny DB over ssh.
18:03:26
pjb
Josh_2: also, in clisp, there's an implementation dependent SCREEN package, which is very simple to use.
18:09:12
pjb
verisimilitude: it includes the standard itself! and generates the code from the standard.
18:09:33
pjb
ok, a sexpified form of the standard, but it's basically a copy-and-paste, and some search-and-replace.
18:09:54
verisimilitude
I specifically didn't want to create a derivative work of the standard document in this way.
18:10:28
verisimilitude
I wonder if this performs the same optimizations of the control sequence that mine does.
18:11:14
verisimilitude
Is this the only other implementation of the ECMA-48 standard in Common Lisp?
18:15:46
pjb
Note that the ideal situation for me would be to just parse the standard text and generate the code from it, not to include it as sexp. But there are always irregularities…
18:17:19
verisimilitude
That's one way to do it. It was much easier for me to simply write it out in a machine-readable way once and let that be it.
18:18:17
verisimilitude
I see this supports the seven-bit and the eight-bit forms; I've been mulling over how to elegantly work that into mine, but haven't done so yet.
18:19:06
verisimilitude
I'm also lazy, which is why I didn't write code to parse a standard document.
18:21:38
verisimilitude
It doesn't seem this implementation performs the same optimization mine does.
18:37:37
vms14
guys, I wanted to make a final project about lisp, but the teacher switched projects between students. So everyone has the project of another student
18:39:53
Josh_2
wouldn't it be better for that person to go learn about lisp themselves, then they might want to actually learn lisp
18:43:58
vms14
I've put things like "Common Lisp is very good when you need a program which changes and evolves."
18:44:11
Josh_2
Something that blew my friends mind was showing small examples using ' and , to control evaluation
18:46:21
vms14
I have 3 slots in my "programmer"s page and I thought I could put some code, like C code, lisp code and other language, doing the same thing
18:47:35
vms14
what I could put as code example to show that with other languages would be a pain and make that code examples short at same time?
18:47:40
makomo
vms14: i'm going to be in the same position in a month or two and i've decided to just go straight for macros
18:47:47
Josh_2
Show doing something that would practically be impossible in C without writing a lisp xD
18:49:25
makomo
from a lot of tutorials/introductions i got the impression that they always talk how cool lisp macros and code transformations are, but never actually show any cool/worthwhile examples
18:50:00
vms14
makomo, usually is because you cannot show how powerful it is if the reader does not understand some stuff first
18:50:15
jasom
well, I *love* macros, but maybe 1% of the lisp code I write is macros. It's one of those "glad it's there when I need it" but not "use everyday" sorts of things.
18:50:38
makomo
so i'll have to think thoroughly how to structure my presentation to cover just enough so that people can understand macros
18:51:35
vms14
the teacher fucked me by switching the projects, I've wanted to use lisp cgi for make an interactive tutorial
18:53:00
ym
Hi. What does it mean when place in setf is a list of two arguments and new-value form is a lambda function? Like this: (setf (foo bar) (lambda (x) (foo2 x bar2))
18:54:48
makomo
same thing, because (LAMBDA ...) is a macro that expands into #'(LAMBDA ...), i.e. (FUNCTION (LAMBDA ...))
18:56:11
makomo
and FUNCTION is a special operator that doesn't evaluate its (LAMBDA ...) argument but treats it specially
18:56:19
jasom
ym: setf is extendable, so if "foo" isn't something builtin to the language, it's going to be covered by one of 5.1.2.(6-9)
18:57:37
specbot
Other Compound Forms as Places: http://www.lispworks.com/reference/HyperSpec/Body/05_abi.htm
18:59:29
makomo
but some of these things you have to know well yourself in order to properly explain them (or at least give a simplified view)
19:00:37
moldybits
vms14: you could give an example of using restarts. another thing is something that takes an arithmetic expression (in sexp form) and simplifies it. you could read the expression from a file with read and output it to another file with write.
19:02:07
vms14
Although Kantz had developed in similar languages before, he had never used Lisp prior to the CPACs project. Further, Kantz wanted to integrate additional functionality and make the CPACs application easier to debug. From his experience with Allegro CL, Kantz now prefers Lisp over any other programming language, and he believes that using Lisp makes applications much more flexible and easy to design, especially for someone getting up to speed in a new
19:06:45
vms14
the problem is I'm so noob and I can just dig a bit, but I'll make a Lisp page sooner or later
19:07:12
pjb
vms14: and in all cases, even if you cannot deliver lisp, you can still use lisp to generate your deliverables. At the very least, use emacs, and write emacs commands in emacs lisp to help you create the deliverables.
19:08:27
pjb
So you implement in lisp some kind of NLP, build a model of the text, apply some algorithm or heuristics to improve then, and NLP back to generate the improved text?
19:08:30
moldybits
vms14: you can write macros for any language, the difference is that lisp makes it easy and, relatively, straightforward.
19:09:45
verisimilitude
The closest thing to Lisp macros in C is an entirely separate program, such as Bison.
19:11:20
vms14
yesterday I was reading one pdf talking about how to make a program able to understand english with lisp
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.