freenode/#lisp - IRC Chatlog
Search
17:27:00
pjb
Odin-: why do you say so? There's a 1-1 correspondance between M-expressions and S-expressions.
17:31:05
pjb
In some sentences they consider integers as symbols to (ie. the confusion between atom and symbol), but this was also stressed by the fact that numbers were not combined with arithmetic operators 42+33, but with lisp functions: (TIMES 42 33) and when you had it as data, it had nothing numeric, it is a symbolic expression, so TIMES, 42 and 33 are symbols like any other atom.
17:31:47
pjb
42 is not a number. It's the representation of a number. There are other representations of the same number: #b101010 for example.
17:48:20
Odin-
Given an M-expression and an equivalent S-expression, I find the S-expression easier to understand.
18:20:57
Bike
clos mop kind of question. reinitialize-instance isn't called on the generic function for every method definition, is it?
18:53:09
aeth
Odin-: The advantage to something like an m-expression isn't that it's easier to understand (although it could be easier to learn), it's that you could (well, with something similar, probably not exactly an m-expression) port existing code almost verbatim from another language.
18:57:30
Odin-
Except M-expressions were originally positioned as the main syntax, not a portability layer...
18:58:50
beach
Bike: REINITIALIZE-INSTANCE is called when you want to pass modified initialization arguments to it.
19:02:09
Odin-
On a completely unrelated note, though: Is there a go-to webserver aside from Hunchentoot?
19:09:13
sjl_
there's https://github.com/jasom/clack-tutorial/blob/src/pages/getting-started-with-clack.org -- no idea how up to date it is
19:10:14
sjl_
But, Clack is more like Python's WSGI or Clojure's Ring -- it's an abstraction over top of existing servers like Hunchentoot so you can swap them out, not really a server itself
19:13:25
Odin-
I noticed. That can be a benefit, but the documentation feels a little ... lacking. :/
20:00:55
jasom
Odin-: if you are confused by anything at all after using my tutorial, let me know, either here or file an issue in github.
23:50:11
margaritamike
I'm not sure if anyone remembers from last time, but I'm hoping to get Common Lisp added to more competitive programming websites, where you can solve algorithmic problems. The effort is progressing for Kattis and there is a possibility of getting SBCL added to Codeforces as well. I was asked a technical Lisp question I did not have the experience to answer. I'm hoping someone could help, because it seems like this may be
23:50:11
margaritamike
the last technical portion in the way before SBCL is added to the Kattis online judge. The question is kind of long so I put it on paste bin
0:13:03
pjb
margaritamike: for multi-file submissions, it would be better to use asdf to deal with compilation-time loading of the dependent files. Otherwise I would add load compile-file of hello in main at compilation-time: https://pastebin.com/2wL73rxc
0:14:47
pjb
margaritamike: notice that in this case, hello.lisp is compiled twice: once when compiling main.lisp, and once when compiling hello.lisp independently. asdf would avoid that. (or using a more complex form in eval-when :compile-toplevel, such as testing for the presence of fasl and timestamps.
0:21:42
pjb
It's ok. asdf is included in sbcl. It can be used to load the system provided by the user.
0:24:40
pjb
asdf = makefile. If they allow multi-file submissions, perhaps they already allow Makefiles for other languages? Otherwise the problem we have to solve is the compilation-time dependencies between the files. We need to load some files into the compilation environment of others (kind of like #include, but we have to compile the included files too).
0:25:50
pjb
Oh, it is also possible to (defparameter *default-pathname-defaults* #P"/src/") to avoid the explicit merge-pathnames. This could be put in ~/.sbclrc.lisp, if --no-userinit is removed from my commands.
0:27:59
pjb
or: sbcl --noinform --non-interactive --no-userinit --eval ' (defparameter *default-pathname-defaults* #P"/src/")' --load /src/main ; then main.lisp could contain just: (eval-when (:compile-toplevel) (load (compile-file "hello"))) (eval-when (:load-toplevel :execute) (load "hello"))
0:28:39
pjb
In any case, it would be a good idea to add this --eval ' (defparameter *default-pathname-defaults* #P"/src/")' to all the sbcl commands, even when using asdf.
0:30:06
pjb
Well, unless it is expected the programs will have access to files in the current working directories. In that case, it may be better to leave (defparameter *default-pathname-defaults* #P"") which is the default.
0:31:04
pjb
(actually, the *default-pathname-defaults* is the absolute pathname of the current working directory with sbcl.)
0:36:16
copec
You know, pastebin offering night mode only to pro users actually made me think about subscribing for half a second
0:38:16
no-defun-allowed
then write a js snippet that flips everything dark if you must have night mode
0:46:00
margaritamike
pjb: thank you for the response. When I get home, I will properly read what you have said to try to give them a concise reply. I'm so excited that it's looking like sbcl is getting added to the kattis platform.
0:52:45
copec
I mean, I'm not totally ignorant - I know of the modern web standards are their relationships with each other, its just not an area I've breached for a long time
2:26:23
margaritamike
pjb: it sounds like life would be easier for them to just use what you have prescribed with asdf and sbcl.
2:26:57
margaritamike
They are trying to add the sbcl implementation anyway, so I don't see why using asdf would be a problem.
2:44:56
pjb
It's built-in most implementations, including sbcl. This is why you can get it with just (require 'asdf).
2:45:54
pjb
margaritamike: on the other hand, this means they will have to have two cases: single .lisp file, or multiple .lisp files with a .asd.
3:05:48
pjb
margaritamike: I wrapped it in a script at ftp://ftp.informatimago.com/users/pjb/clipboard/compile-and-run-with-lisp.tar.bz2