freenode/#lisp - IRC Chatlog
Search
13:00:25
jackdaniel
gypsydave5: correct way of loading it would be (asdf:load-asd "file.asd") without changing package in your repl
13:00:58
jackdaniel
in principle asdf may introduce its own reader at some point and load simply won't cut it (even from asdf package)
13:02:32
jackdaniel
I wouldn't be very suprised, if one day defsystem will start to expand to (progn (unless *load-asd* (error "boo")) (do-defsystem …)) ;-)
13:05:16
gypsydave5
jackdaniel: just wondering why the first system load worked - (asdf:load-system "parenscript") - and the second didn't. I can't see what the significant difference is between the two.
13:07:41
gypsydave5
So ASDF already _knew_ about the parenscript system, but not about the parenscript.tests system
13:10:37
jackdaniel
thodg: why should it be patched? parenscript.test is defined in its own file parenscript.test.asd, so it conforms to asdf requirements
13:12:09
jackdaniel
try (ql:quickload 'parenscript.test) ; (if you have QL) - that will fetch dependencies for you
13:14:43
gypsydave5
OK - I am now less stupid than 20 minutes ago - success. Thanks jackdaniel and thodg!
17:58:17
Xach
rk[ghost]: well, sort of. a favicon is just responding to a request for "GET /favicon.ico" So a handler that matches that will return the result that the browser displays.
17:59:04
pjb
Add those head tags: <link rel="icon" href="/favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
18:00:58
rk[ghost]
also, someone mentioned that my text files are being given as octet stuff, so their browsers defaulting based on memetypes is trying to make 'em download
18:01:14
rk[ghost]
which, mostly on their end as i see it, but.. if i have a file.. can i choose how it is served?
18:01:35
rk[ghost]
i don't fully understand mimes and browsers, so my questiosn may be murky at best
18:02:04
pjb
Yes, you should specify a "Content-Type: text/plain; charset=utf-8" or something like that.
18:02:13
rk[ghost]
pjb: i appreciate you showing me that, because i would rather organize the location myself as, i have multiple pages that use the same base /var/www/
18:03:11
pjb
So searching for Content-Type and hunchentoot on google, and searching for Content-Type on w3.org, should give you all the info.
18:05:55
rk[ghost]
sorry that this isn't lisp specific, but since i changed the topic to www.. (XD) is there a suggest size for the favicon?
18:12:20
tumdum
I followed instructions from https://lispmethods.com/libraries.html and got bobbio working, but when I try to do those steps for my own project something (most likely trivial that I fail to spot) fails: https://gist.github.com/tildecat/0ad15a773327946defedf62d7f85c1cf any ideas?
18:16:03
jackdaniel
tumdum: ah, also another thing may be wrong. your symlink doesnt' seem to point to a directory, notice that /home/t/dev/euler vs /home/t/dev/bobbio/ (latter is a directory)
18:16:46
jackdaniel
so you should `ln -s /home/t/dev/euler/` instead of `ln -s /home/t/dev/euler` (I think this may be important wrt symlink following)
18:18:14
jackdaniel
symlinks are nasty (especially if you try to depend on them with code which is meant to run on different implementations)
18:24:45
Xach
It is entirely related to the timestamp of the directory vs the timestamp of the index file.
20:07:17
slaterr
using such a long name for a one-off function written in lambda form is not warranted
20:08:42
confusedwanderer
slaterr: maybe you can steal some code from https://lispcookbook.github.io/cl-cookbook/cl21.html#shorter-lambda
20:09:40
slaterr
I can't think of an example where naming a single element would be necessary. if verbose name is warranted, list of those things already has such a name in plural form
20:21:19
_death
I guess it's hard to unlearn clojure aesthetics because you consider it part of the same family.. but really, it's not idiomatic CL
20:21:29
slaterr
pjb I am implementing clojure's # reader macro in CL. I don't know syntax of CL equivalents well
20:23:45
confusedwanderer
i think the freedom to change these things is part of what makes lisp fun. you shouldn't introduce notation like that in someone else's projects without asking, but for your stuff it's your choice
20:23:48
dlowe
I assume map to stand in for any number of mapping things that takes a function and a sequence
20:23:52
pjb
A lot of lisp code is packaged into libraries distributed thru quicklisp. A lot of problems with those libraries come from bad handling of reader macros in the source code of those libraries.
20:24:28
pjb
(second bad problem, is nickname collision! Fucking don't use short package names or nicknames!)
20:32:35
dlowe
It doesn't bother me when people want to tinker in weird ways with lisp syntax. I love it. Why program in lisp, otherwise? However, I am annoyed when a stylistic opinion is asserted forcefully as an obvious and irrefutable fact with which only a moron could disagree.
20:37:59
drmeister
Hi - does anyone like programming in assembly language and want to contribute to an open source Common Lisp project?
20:39:32
drmeister
LLVM can be used to create function invocations with a fixed number of arguments.
20:39:40
slaterr
dlowe if you scroll up, it wasn't me who started challenging "stylistic opinions" of others. it was you and _death
20:40:46
drmeister
But creating a call with variable number of arguments assembled from a fixed argument call where the last argument is either a Common Lisp list or a va_list (C++ ism).
20:41:02
sjl_
slaterr: #() already means something in Common Lisp. Changing it would be confusing, even if you managed to make it work. If you pick a different character, and use the named-readtables library to make sure not to pollute unsuspecting readtables, it should be possible to implement.
20:42:16
slaterr
dlowe yeah? it seems like you did get butthurt, protecting 15 minutes after discussion ended
20:42:57
slaterr
sjl_ I mean it doesn't matter to me. I am fine using something other than #. redefining # would be bad, assuming it is even possible
20:43:03
dlowe
slaterr: I wanted to make sure you were pushed back on a bit. Anyway, it might not have been about you.
20:45:20
_death
I guess every Lisper has this phase of experimentation and fascination with microsyntactic "optimizations" at some point.. then you grow up
20:45:25
slaterr
dlowe, you should have pushed back when I shot down your silly widget-count example. but, because you didn't (and couldn't), we are still discussing this 45 minutes later
20:47:28
slaterr
so you think simple, one-off few characters anonymous functions should have very verbose names for their arguments? no wonder you like loop, you have no sense of style or aesthetics
20:49:41
rk[ghost]
hmm, i am currently using CLL. my typical strategy for reloading my program is to (quit) and then (load "file") again. i am working on ways to modularize and load bits and have it do things from within modules.. however, is there a REPL command to "unload everything" (to prevent clobbering) so to avoid quitting and returning back to shell?
20:50:51
dlowe
rk[ghost]: many times you can reload source code without even stopping execution of the program
20:51:12
rk[ghost]
dlowe: i just don't want to remove extra variables in the debugging process. would be really annoying to be doing things and then find out it is because something old was still loaded in.
20:51:55
dlowe
rk[ghost]: yeah, that does happen. The usual method of development is to use "system" files like asdf that can track what files have changed
20:52:17
rk[ghost]
i see.. i will probably get there in time, but sometimes it is useful to know the hacky solutions XD
20:52:19
dlowe
but you can also compile and load individual functions and variable declarations into your running image
20:52:30
_death
rk[ghost]: then you have a good idea what you just redefined and what is the current state of the system should be
20:52:30
slaterr
dlowe this was forcefully asserting my stylistic opinion, just so you can tell the difference. as opposed to just explaining why I'd prefer clojure-like macro, when being told that I shouldn't
20:52:57
rk[ghost]
right but for instance what if the second run of a file doesn't have a defparameter *var*..
20:53:12
rk[ghost]
in such case i wouldn't expect *var* to be visible anymore, but yet it should be, eh?
20:54:55
rk[ghost]
slowly i am attempting to have my modules have "upgrade" functions like in OTP.. i'll probably eventually try to migrate things to lisp-flavoured-erlang XD
20:55:36
rk[ghost]
plus, then i would have to migrate things like Hunchentoot, which i don't fully understand.
20:56:00
dlowe
slaterr: it can really suck to feel piled upon, but there's a lot of different opinions in the channel, and I was just saying how much I liked the (shorter) plambda
21:00:01
slaterr
dlowe yeah, one second you liked shorter plambda, then next second you recommended an even longer than necessary lambda variant. it seems you just like to argue for the sake of it
21:01:46
rk[ghost]
... not having luck with the favicon.. just aesthetics, so i guess i will just abandon it..
21:05:45
dlowe
slaterr: I figured there was an understanding that these example bits of code were stand-ins for something potentially more complex, where a longer name would have value, contrary to your assertion that the specification of the argument was completely lacking in worth.
21:06:28
dlowe
and I have seen a lot of complex code that used single letter a-z variable names and it was terrible
21:07:02
slaterr
then your understanding was poor. and if function arguments warrants a verbose name then it shouldn't even be a lambda
21:08:09
slaterr
a-z variable names are excellent in very short functions. your proposed variable name was several times longer than the useful characters in the body of a function
21:09:13
slaterr
and you have to repeat variable name twice.. completely drowning the actual useful code in that snippet with unnecessarily long variable names.
21:09:56
_death
right, there are many times where a lambda expression is stylistically suboptimal.. and using something like #(... % ...) only makes it more difficult to recognize
21:11:53
slaterr
_death only if you are unfamiliar with the syntax. and the same argument can be used against any user-defined macro with non-standard naming convention and semantics
21:14:51
_death
every abstraction has a cost, and such crutches (and clojure has more of them, unfortunately) add up.. they help keep the code short at the price of hiding more useful abstractions
21:17:43
_death
so locally they seem nice (if you don't mind cryptic names like "%" or "->") and short, but overall they get you boilerplatish low-level code..
21:17:44
slaterr
what more useful abstraction would you use here? we are just passing a 3 character function to map
21:19:20
_death
slaterr: your example is a toy example, so your toy solution looks clever.. instead of trying to come up with something better for the toy example, I am just sharing my experience with such things
21:20:44
slaterr
a toy example? so you never had to do some simple operation to a list of things? you never use map?
21:21:22
_death
slaterr: so my experience tells me that a plain lambda there is OK.. and then when there's more code and it things get more complex, it's easier to see the patterns
21:23:13
slaterr
so we agree that # is better at lambda's job, than lambda. creating simple, short functions on the fly
21:23:22
_death
so instead of trying to optimize lambda syntax, keep it plain and optimize when it counts
21:24:32
pfdietz
Don't know if this was mentioned: https://github.com/eschulte/curry-compose-reader-macros
21:25:38
_death
slaterr: for reading, I do use pretty-lambda which substitutes the greek letter for the word
21:26:01
slaterr
pfdietz that is nice. I'd argue even nicer if you are just using lambda or # to emulate partial application
21:32:25
slaterr
{+ 1} syntax for partial application comes very close to haskell's (+ 1). it also supports positional arguments, and function composition. a lot nicer and more powerful than #'s
21:35:50
pjb
slaterr: if you publish your sources (eg. to quicklisp), then yes, if you do it naively.
21:36:28
pjb
slaterr: the point here is that LOAD specifies that the file is loaded in the context of a (let ((*readtable* *readtable*)) …)
21:37:11
pjb
Instead, you must SET the *readtable*. (eval-when (:compile-toplevel) (setf *readtable* *my-file-readtable*))
21:44:56
pfdietz
Both LOAD and COMPILE-FILE bind both *PACKAGE* and *READTABLE* (to themselves) before processing the file, so changes to either during the load/compile do not escape.
21:46:02
pfdietz
Changes as in changes to the variable, not changes to the package or to the readtable objects.
21:51:07
fiddlerwoaroof
An alternative to messing with the lambda syntax is to define higher order functions that combine other functions to produce the lambda you want
21:57:21
_death
fiddlerwoaroof: this reminded me of this snippet https://gist.github.com/death/34d4bd499b323016fa65be5ba72fabc1
22:00:53
rk[ghost]
ha.. gee.. changed the .ico to a .png.. maybe ff doesn't support the x-icon type.. it just worked.. yaay:D
23:10:48
fiddlerwoaroof
_death: yeah, I have a library that implements this pattern: https://github.com/fiddlerwoaroof/data-lens
23:10:59
jmercouris
let's say I've done (ql:quickload :some-library), how can I get the system-version loaded
23:11:16
fortitude
ASDF defines systems as a tree of components; each component might be something more specific like a module or a file definition
23:16:19
fiddlerwoaroof
(defining methods for generic functions you don't own for classes you don't own)
23:17:14
fiddlerwoaroof
On the other hand, "someone" could define a library for querying ASDF for various bits of information
23:18:57
fiddlerwoaroof
(to be clear I'm not referring to anyone in particular, just making a joke about every annoying problem being someone else's problem)
23:19:29
fiddlerwoaroof
It's the kind of thing I'm interested in, but I never seem to have the time for
23:20:14
fiddlerwoaroof
At a very simple level, just define some functions (asdf-query:system-version :alexandria)
23:21:13
jmercouris
thanks, have you seen the branch? it is quite different than the current incarnation
23:21:21
fiddlerwoaroof
I don't know if you've run into the little bug where the start-swank command seems to kill the app on mac
23:32:38
mrpat
What is the best package for downloading https sites? It seems cl+ssl is messing with my Drakma and Dexador.
23:36:31
jcowan
No, Smalltalk and Ruby are the kings of monkey-patching. You can do it in pretty much any dynamic language, but in a lot of langs the culture won't let you.
23:40:12
fortitude
mrpat: drakma and dexador should both work without having to set up cl+ssl first, but cl+ssl can have issues on some systems (windows)
23:40:31
fortitude
I think dexador bundles its own certificate store, which should avoid most of the problems if its recent enough
0:02:27
fiddlerwoaroof
A former coworker wrote a nice blogpost about the problem: https://lexi-lambda.github.io/blog/2016/02/18/simple-safe-multimethods-in-racket/