freenode/#lisp - IRC Chatlog
Search
18:23:12
jcowan
two questions: how strong is the convention that package names (at least user-visible ones) use only uppercase letters and hyphens?
18:26:18
jcowan
second, is CLtL1 online anywhere? I have a hard copy, but I wanted to look up something quickly
18:27:11
pfdietz
Hyphens vs. underscores is traditional. I suspect it goes back to the character sets at the start of Lisp not having underscore.
18:30:51
pfdietz
Package names being upper case comes from the default reader, which is again traditional, and which upper cases everything. Lower case characters would require escaping with | |.
18:37:58
didi
I always wonder what would break if I change `readtable-case'. For example, how many packages use `foo' and `"FOO"' as synonyms.
21:48:01
phoe
Which are function objects, symbols that name functions, and SETF forms that name functions.
21:49:01
phoe
It seems that the only difference is that ENSURE-FUNCTION does not work in case of lambda forms.
22:33:01
didi
In `format', can I fix the value of `v' so it's used for multiple args? For example, instead of writing (format t "~{~vD~}" (list 5 1 5 2 5 3)) so (eql v 5), I want to write something like (format t "~{~vD~}" 5 (list 1 2 3)), that is, `5' only once.
22:38:57
pjb
didi: (format t "~:{~VD~}" (mapcar (lambda (x) (list 5 x)) '(1 2 3 4 5))) #| 1 2 3 4 5 --> nil |#
22:39:08
LdBeth
jcowan (IRC)jcowan (IRC) Original text of CLtL1 is included in CLtL2, the later is annotatiton on first version for mofifications.
22:40:28
pjb
didi: (defun fmt-5V (stream val colon at &rest args) (format stream "~5D" val)) (format t "~{~/fmt-5V/~}" '(1 2 3 4 5)) #| 1 2 3 4 5 --> nil |#
22:41:40
didi
pjb: This is interesting. I tried something like that with `FLET', but the function wasn't found.
22:41:48
pjb
didi: (defvar *w* 1) (defun fmt-D (stream val colon at &rest args) (format stream "~VD" *w* val)) (let ((*w* 5)) (format t "~{~/fmt-D/~}" '(1 2 3 4 5))) #| 1 2 3 4 5 --> nil |#
22:44:27
didi
It's a little brittle. I wrote a version of ~D that also accepts strings as arguments to use with ~/.
22:48:14
pjb
~D already accepts strings. ~A is left align, and ~D is right align: (format nil "~5A ~:*~5D" "Foo") #| --> "Foo Foo" |#
22:51:35
pjb
But strangely (well, not really), only clisp implements padchar with ~D correctly for non-integers: (format nil "~5,,,'*A ~:*~5,'>D" "Foo") #| --> "Foo** Foo" |# "Foo** >>Foo" in clisp.
0:01:50
gendl
Hi, how do we feel about the :iterate system? (from Jonathan Amsterdam; available in Quicklisp from repository maintained by Attila Lendvai on gitlab.common-lisp.net)?
0:02:49
gendl
I am with a customer who is dealing with converting a bunch of old code using a proprietary ICAD iteration construct called `let-streams'
0:03:33
gendl
I have also been gifted a set of functions which purport to translate let-streams forms into iterate forms.
0:04:07
gendl
well, ICAD does not exist anymore, so this code must be migrated off of let-streams somehow or other.
0:04:54
gendl
The customer has also embarked on a consulting project which converted the let-streams into LOOP constructs.
0:05:10
gendl
To me, these let-streams look much more similar to iterate forms than they do to LOOP.
0:06:02
Bike
the main selling point of iterate is that it can do what loop does, but with a more regular "lisp like" syntax
0:06:51
gendl
I'm leaning toward nudging the customer in the direction of iterate, if this is something I am going to sign up to support.
0:07:12
gendl
The customer is probably going to want to tend toward sticking with something which is in the standard, if possible, though.
0:07:38
gendl
But if I can make a case that iterate is stable, well-defined, not likely to disappear or experience chaotic changes...
0:09:37
Bike
well, as far as stability goes, the cl-net page says it predates the standard, so it's not like something someone came up with on a whim five minute sago
0:10:53
gendl
they were something of competitors back in the day, though neither made it into the standard, in favor of LOOP.
0:12:21
Bike
that is kind of weird, but you can get similar weirdness from typed value accumulation in lisp
0:14:09
aeth
Where I've gotten weirdness in LOOP is an unreachable code deletion warning in SBCL for ":for foo := (bar ...)" where foo isn't used on the first iteration through the loop.
0:14:39
aeth
Since ":for foo := (bar ...)" presumably expands to ":for foo := (bar ...) :then (bar ...)" when there's no then
0:16:58
aeth
If you want no magic, use DO because that's usually pretty directly expanding into a LET over a TAGBODY with a GO when you macroexpand-1.
0:17:55
aeth
On the other hand, the magic is sometimes very useful, like collect/append (there are higher order function equivalents, but only when not collect/append is not conditional)
0:19:38
aeth
And while LOOP is normally equivalent to DO* for things like :for foo := (bar) :then (baz), there is no short :for foo := (bar) with DO*. Not having the increment step is like LOOP's :with. So it could potentially reduce a lot of duplication there
0:23:15
aeth
pillton: You might be interested in this commit because the original didn't compile in ECL: https://gitlab.com/zombie-raptor/zombie-raptor/commit/1a5148dee2a3a08eee0c30cc6d51e30dc2829641
0:23:53
aeth
("vec" is shorthand for vec3 because it's the most common vec by far in my engine. Define function just is defun with declaims/declares built in.)
0:30:17
aeth
I suspect a simplified case would look something like (defun foo (u1 u2 u3) (declare (vec u1 u2 u3)) (let ((v1 (make-vec)) (v2 (make-vec))) (declare (vec v1 v2)) (vec--into! v1 u1 u2) (vec--into! v2 u1 u3)))
0:32:02
pillton
Hmmm.. something I can evaluate without having to load anything other than specialization-store.
0:43:12
aeth
I'll have to look into it some more. (Making it standalone is much easier, I just need to macroexpand the macro that generates the defspecialization)
3:03:39
gendl
Thanks. I should read more before I ask here. I'm just playing with this old code which supposedly converts to iterate code so I was believing what it was outputting.
3:04:42
gendl
I think i might not be using the converter right. I probably have to do some package-fu to get the old let-streams operators to be recognized by the converters.
5:08:47
beizhia
Here's a question I may as well ask here: I've finally figured out why developing with Slime and the REPL is so awesome (making a little website with hunchentoot). How do I bridge the gap between that and C/Java/Ruby, where I'm used to deploying a project as a whole?
5:17:56
fiddlerwoaroof
beizhia: you write an asdf system definition and then start a fresh repl, load your system + all its dependencies and dump an image
5:20:32
fiddlerwoaroof
You can get pretty fancy with how you do it, but I often just write a little build script and run it with sbcl --load
5:20:33
fiddlerwoaroof
https://github.com/fiddlerwoaroof/dotfiles/blob/master/stumpwm.d/build/build.lisp
5:21:03
fiddlerwoaroof
Here's another example: https://github.com/fiddlerwoaroof/objc-lisp-bridge/blob/master/Makefile#L9-L11
5:22:54
beizhia
aha nice. I'll give those a deeper dive in the morning. Thanks for the example code!
5:23:40
beizhia
I still cant figure out if I'm just having a tough time with this, or if it's really quite different from everything else out there
5:24:39
fiddlerwoaroof
The only similar systems still around, as far as I know, are smalltalk systems
5:25:38
fiddlerwoaroof
You "build" an application by dumping the current state of your lisp implementation and then loading that back into the lisp implementation next time you run your app.
5:26:26
fiddlerwoaroof
It's more like the way docker containers work than the way something like Makefiles, mvn, cargo, etc. work
5:30:44
beizhia
I kinda prefer that. Feels a little more grounded in reality. I totally still feel more at home reading source files in a static typed compiled language.
5:31:50
fiddlerwoaroof
Yeah, if you really get into desigining stuff for exploration at the repl, you start missing the types less
5:32:01
beizhia
Just moved over to doing a lot of Javascript at work and honestly Lisp is helping me understand JS a lot.
5:32:30
fiddlerwoaroof
I've noticed that a lot of the practices $work promotes for designing testable code also lend themselves nicely to designing repl-friendly code
5:32:38
beizhia
I've been seeing that. Read a great article contrasting unit testing with REPL programming.
5:32:55
fiddlerwoaroof
i.e. writing small pure functions wherever possible so that you don't have to worry about io/etc.
5:33:01
beizhia
Basically, both are just the simplest way of calling a function, is what they mentioned.
5:33:26
beizhia
Ya, trying to emphasize that point with my team... We have a lot of several-hundred-liners in our code.....
5:33:41
fiddlerwoaroof
Also, don't be afraid of CLOS, I found it entirely changed my perception of what OOP means
5:34:17
beizhia
Heh, that's what this little tutorial is walking me though actually. I'm getting it. CLOS is rad.
5:34:31
fiddlerwoaroof
beizhia: if this were #js, I'd strongly recommend using ramda as the standard library of JS
5:37:04
minion
beizhia: direct your attention towards pcl: pcl-book: "Practical Common Lisp", an introduction to Common Lisp by Peter Seibel, available at http://www.gigamonkeys.com/book/ and in dead-tree form from Apress (as of 11 April 2005).
5:37:29
beizhia
I have before, a couple times. I should probably hit it again though, now that I know more.
5:38:03
beizhia
This is maybe my 3rd earnest go at getting into LISP, and I think it's starting to stick.