freenode/#lisp - IRC Chatlog
Search
8:09:51
beach
semz: There is independent research that suggests that expertise requires hard work. I recommend a book entitled "peak" by Anders Ericsson.
8:10:43
beach
Note, though, the direction of the implication arrow. Hard work does not necessarily result in expertise, as we often see in the domain of software development.
8:14:21
schweers
So the question might be: how do we prevent people from doing hard work which does not result in, or otherwise further, expertise?
8:18:30
beach
jackdaniel: The baldness thing was an example of how preposterous the claims of these closed-minded people might be, and how they will do anything (including ridicule) to avoid learning new things. And you are a good example of how preposterous that claim is.
8:18:42
White_Flame
you're not just doing work, but working with somebody, seeing a direct example of how they benefit from the work and tune it to positive effects
8:22:54
jackdaniel
beach: there are many rude people whose behavior doesn't need to be explained with complicated theories, I'm sure that if they have no problem with saying "only bald people use lisp" then leaving lisp of it and saying "bald people are <whatever>" is as likely if they do not like the person in question (and 'baldness' could be replaced by any visible trait of said person)
8:30:50
schweers
I have a quick lisp question. I have a pathname object and want to construct a new one based on it. In UNIX I’d just append "../somedir" to get the directory part. What is the most portable (both concerning lisp implementations and OSes) way of doing so? Using a "/" character is obviously not the best move here. I could use nested MERGE-PATHNAMES, but that just seems wrong and overblown. Is using '(".." "somedir")
8:33:57
Colleen
schweers: About pathname-utils https://shinmera.github.io/pathname-utils#about_pathname-utils
8:37:54
schweers
Shinmera: Thanks. I just took a look at the code and found out that :up can be a directory part. I guess this alone solves my problem.
8:49:42
ralt
I think what you'd want is something like (defun merge (orig &rest pathnames) (reduce #'merge-pathnames pathnames :initial-value orig))
9:02:13
thijso
although you might pick up some less ideal things if you look at code that doesn't follow conventions etc
9:05:26
jackdaniel
if there were no print I would have no guarantee that anything appears on the screen
9:06:09
jackdaniel
sure, still putting just a string would be less ideal, by screen I've meant 'standard output' of course :)
9:10:53
beach
It is easy to understand what it does (it is the Common Lisp READ function with extensions).
9:12:17
schweers
Thank you duckduckgo for telling me about some spaceship in the Marvel Cinematic Universe, before telling me about the lisp project :D
9:21:57
beach
saturn2: And it is actively developed and maintained, so you can ask questions about it. Either here or in #sicl.
12:17:57
lxbarbosa
I did know that Reddit was written in Lisp before switching to Python then to React... :d
13:25:07
decent-username
Good morning. I'm pretty close to finishing the Line Of Sight algorithm for my rogue like. Right now I have a 2D array that cotains objects of typr 'cell which encapsulate things like "is this cell visible". My question is: How can I change the printed representation of an object?
13:55:15
White_Flame
it's a plain function, you could look up stuff in external tables as well; it doesn't need to be self-contained on the object itself, if it's easier for you to manage differences there
14:01:47
minion
The URL https://gitlab.common-lisp.net/users/sign_in?secret=7cebaac8 will be valid until 14:15 UTC.
18:27:17
vms14
dlowe: why would be better to have html with some way for lisp code interpolation, instead of stuff like cl-who which are directly lisp code?
18:28:03
vms14
it seems at first time html would be better, but maybe letter you'd be happier with a more lispy solution
18:30:37
dlowe
vms14: if you are working with a web design team, they will not use the lispy solution that you claim is superior
18:31:24
Xach
I use html-template and cl-who together, but I bet there are newer, nicer options for both sides.
18:38:45
Xach
vms14: the evaluation rules have to be memorized and internalized if you want to use it effectively. they are not too complicated but you *must* know them by heart or you will get confused.
18:51:24
pjb
vms14: https://github.com/informatimago/lisp/blob/master/common-lisp/html-generator/html-generators-in-lisp.txt
18:58:33
jmercouris
Ober: you can read more about them here: https://en.wikipedia.org/wiki/S-expression
19:43:01
vms14
macro-html depends on named-readtables and shadows map and time as those symbols collide with HTML element names
19:45:07
aeth
cl-who afaik walks through all of your source code within the macro and substitutes anything inside (htm ...) with the appropriate transformations to string writing functions... so it's possibly the most efficient approach, but I personally hate when there's magic like that.
19:45:38
aeth
Having to hardcode HTML tags doesn't seem like a robust approach because, as I said, it's a "living standard" so now you have to constantly update your library. You do have to hardcode what the empty elements like <br> are, though.
19:47:15
aeth
It seems really weird to define a macro for every html element instead of just using keywords and handling it with one macro like (with-html (stream) (:foo 42)) and, as you noticed, it does have potential name conflicts
19:48:28
aeth
and when you have each thing be its own macro, you have to do something like rely on rebinding *standard-output* like that library does, I guess. Because it'd be really inconvenient to have to pass in a stream to every BR
19:49:21
aeth
vms14: you don't need to know about any tags to write HTML except for the empty elements like <br>
19:51:18
aeth
vms14: if you don't know that the tag exists, and if you do it in one big keyword macro instead of namespacing each tag in macros (or function calls or w/e) that have to know each tag... then, yes, if it's unknown it's just <tag>...</tag>
19:51:22
vms14
but if you're making a library for doing this, better if we provide access or a way to add tags
19:53:27
vms14
if you write a big macro then you need to provide a way to put stuff inside <tag > like :src "url"
19:55:03
aeth
there are two syntaxes that work... (:tag :src "url" "foobar") and (:tag (:src "url") "foobar) where in the former case you iterate until you no longer get a keyword-and-value pair and that's the end of the attributes and in the latter case you always have an attributes list after every tag (more regular, but also means your code will probably be full of ()s)
19:58:57
aeth
vms14: The reason you need to know about empty elements is because (1) they close like <foo> or <foo /> depending on the style and not <foo> </foo> and (2) you want there to be an error if there's a body and not just attributes
19:59:30
aeth
For all I know, in XML <foo /> and <foo> </foo> are interchangable, but HTML is not that kind.
20:00:16
aeth
The lazy approach that you'd probably see in 95% of libraries that do this is to use a list.
20:00:53
aeth
What you should probably do, though, is you should probably use a member type, and for user configuration, also check a predicate function (perhaps an overridable method that by default turns nil? or maybe even just put it as a satisfies type)
20:01:59
aeth
a higher order function could also work, but that makes the macro much messier if you need to override it so maybe just a method that always returns nil and letting the user do :after will be the best approach