freenode/#lisp - IRC Chatlog
Search
16:12:00
Xach
I don't know why clisp is doing that, sorry. I don't use clisp a lot, but when I do, I haven't gotten signal 6 quits.
16:15:17
paule32
REINITIALIZE-SOURCE-REGISTRY-AND-RETRY :R1 Retry finding system cl-ppcre after reinitializing the source-registry.
16:49:08
pjb
dmiles: each implementation has a lisp reader of course. I don't know if sicl already has one implemented. You may have a look at: com.informatimago.common-lisp.lisp-reader.reader
17:19:44
mfiano
Xach: Ok, please let me know if you get build failures for gamebox-math from this morning's pull.
18:26:54
paule32
pjb: so, i don't know, if it a homework to get the right values/content on the output, you marked with !!! expected 1
18:36:41
rumbler31
paule32: Vielleicht sollen Sie etwas aenders als clisp benuetzen. Z.B ccl or sbcl
18:38:48
rumbler31
one good reason, is that clisp is old (2010-07-07), and trying with ccl or sbcl is easy, and you can get more help with those
18:40:41
rumbler31
well, right now, new versions are released frequently. Also, do you still use windows xp? or have you upgraded to windows 10, or 7?
18:42:18
rumbler31
so you like using a new version of linux, but you won't try a new version of lisp? :-)
18:42:30
pjb
paule32: type (apropos "TOPOLOGICAL-SORT") this should show you what package it comes from.
18:43:24
pjb
paule32: obviously you cannot remove it, it's an important part of the algorithm. Instead, you can try to design a different algorithm to evaluate a circuit.
18:47:41
pjb
This imports all the usual packages from the com.informatimago, so my functions are available.
18:48:21
pjb
(actually, I do that in a com.informatimago.pjb package, and I just use it in cl-user and others.
19:06:47
pjb
paule32: in the mean time you can just remove com.informatimago.tools.manifest from the systems to load.
19:26:04
pjb
paule32: why would you expect output from loading a lisp source file, and then QUITTING!?
19:30:05
mgsk
Is it possible to do something like (defun something (&key a b &rest c) ...) where in (something :a 1 :b 2 :c 1 2 3) they keyword :c "collects" all remaining forms, i.e. C = (1 2 3)?
19:31:50
Xach
What actually happens is that the &rest var collects subsequent keyword/value pairs. but they have to be matched.
19:32:57
Xach
(defun make-a-thing (class-name &rest args &key &allow-other-keys) (apply 'make-instance class-name args)) for a dumb example
19:35:27
mgsk
I was just thinking about how use-package (in emacs) allows for arbitrarily many forms to be given to a keyword (until the next keyword). But rather than complicate things, I'll re-think my design
19:47:28
pjb
paule32: why does it quit in the end? You're doing it wrong! Never quit from a lisp image!
19:52:36
pjb
mgsk: for example, something like (let ((arguments '(:a 1 :b 2 3 4 5 6))) (destructuring-bind (&key a b c) (loop with expected = '(:a :b) while (and arguments (cdr arguments) (member (first arguments) expected)) collect (pop arguments) into keys collect (pop arguments) into keys finally (return (list* :c arguments keys))) (list :a a :b b :c c))) #| --> (:a 1 :b 2 :c (3 4 5 6)) |#
19:55:46
pjb
mgsk: so (defun foo (&rest arguments) (destructuring-bind (&key a b c) (loop with expected = '(:a :b) while (and arguments (cdr arguments) (member (first arguments) expected)) collect (pop arguments) into keys collect (pop arguments) into keys finally (return (list* :c arguments keys))) (list :a a :b b :c c)))
20:44:31
phoe
paule32: using Lisp without slime is a terrible experience. you might as well be using a non-interactive language like C or Java.
20:46:02
phoe
doesn't matter what Java is. coding in Lisp without any kind of interactivity layer for it prevents you from taking advantage of one of its most important features.
20:51:34
paule32
pjb: $ clisp elo.lisp # in elo.lisp: (load "./init.lisp") ; where your code from paste
20:57:55
pjb
paule32: well, perhaps you don't have a clean cl-user package. Of course, I've already explained years ago, that one should clean his cl-user package in the rc files…
21:00:22
pjb
paule32: then add (load (merge-pathnames (make-pathname :directory '(:relative "RC") :name "COMMON" :type "LISP" :case :common) (user-homedir-pathname) nil)) in your ~/.clisprc.lisp file.
21:00:34
aeth
Would it be possible to write something that automatically recompiles all users of a macro, struct, inline function, etc., when it is recompiled? Basically, all of the stuff that can go stale.
21:01:03
aeth
(structs doing this, of course, is implementation-specific, but it would have to be done to be portable, and to support SBCL)
21:01:21
phoe
Write a custom DEFUN/DEFMETHOD/DEFeverything that codewalks the forms and finds all uses for the macro in question.
21:01:44
pjb
aeth: have a lookt at: Image Based Development http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/ibcl/index.html
21:01:57
phoe
Then write a custom DEFMACRO that, whenever a macro is recompiled, finds all users of that macro stored via the above forms, and recompiles them.
21:02:15
aeth
phoe: I was hoping that there was an easier way. SLIME and/or ASDF probably already know certain things.
21:02:33
pjb
aeth: this way you can save the source of each form; you may add a plist to macros, structures, inline functions, etc, to list all the things that need to be recompiled.
21:02:53
Bike
i don't think they implementations actually usually track macro usage, just function usage, which they need to know for linking purposes
21:06:19
aeth
What has issues with recompiling, btw? I'm aware of inline functions, macros, and sometimes (afaik it's implementation-specific) structs.
21:07:53
aeth
I think package definitions also have issues, but only if you remove things (rather than add things)
21:08:07
aeth
But you can remove those manually by going into the package and uninterning manually iirc
21:09:05
Bike
depending on how you construe the workings of load-time-value in relation to compilation, maybe you'd need to recompile for lots of random reasons
21:09:33
Bike
strictly speaking, some properties of classes, though i don't know if any implementation actually takes advantage
21:09:37
aeth
Oh, actually, I never have to do the whole in-package thing for uninterning ever again, in implementations that support foo::(unintern 'whatever)
21:13:31
aeth
the syntax is: (unintern 'foo::some-symbol-to-remove :foo) because I need to tell it to remove the 'some-symbol-to-remove that's in foo
21:16:19
aeth
Anyway, my actual point was: if I recompile a function without recompiling the defpackage that imports the new symbol (oops), I now need to unintern that symbol before recompiling the defpackage or else there's a conflict that the debugger wants me to resolve.
21:18:12
Xach
You get "undefined function frob" and you change defpackage to :use the package that provides frob and you get a conflict?
21:18:25
Xach
That happens to me - when it does, I use shadowing-import-from to clobber the existing one.
21:23:37
pjb
paule32: great. so now you can load your code; it would be nice to define your own package for it. Then you can use the com.informatimago.common-lisp.cesarum.utility package.
21:24:25
pjb
paule32: so after you've loaded the file, you can go on programming, testing, and debugging.
21:25:08
pjb
paule32: I don't know how many years ago you've started with lisp: you've made clearly no progress since that day. This is because you don't use the REPL.
21:25:22
paule32
pjb: hehe :-) but it is a little bit boring always to load clisp and type (load foo.lisp)
21:25:31
pjb
paule32: so start using the REPL, at least in the terminal (with clisp it's liveable since there's readline). Better with slime.
21:25:53
pjb
paule32: you don't always load clisp: you load it once when you boot your computer and that's it.
21:26:46
aeth
paule32: pjb is 100% correct. The proper way to learn CL is to think up small test cases and see how they evaluate in the REPL, preferably the SLIME (or similar) REPL so you can also interact with existing source files.
21:27:06
pjb
paule32: you don't type (load "foo.lisp"). In a project, you create a loader.lisp file that will load it, and you type: ll RET at the REPL, with my command.
21:28:41
pjb
and since you always have clisp running, you don't need a shell anymore. You can close your other terminal windows, and use clash to run shell commands: https://clisp.sourceforge.io/clash.html
21:30:00
pjb
with clash and readline, you type Meta-c unix-command RET in the REPL to run unix-command.
21:31:06
paule32
pjb: the problem: i can't use cursor-up: i expect the last typed command line, but [[A comes
21:32:24
aeth
If you want to launch programs from the REPL, you can use uiop:launch-program (asynchronous) or uiop:run-program (synchronous)
21:32:41
aeth
(Note: launch-program is a newer feature, so you probably have to Quickload UIOP first.)
21:35:49
paule32
amd i wonder, why the compiled system run so fast - in fact, the fasl's are ascii text file's
21:36:01
pjb
paule32: also, see the call to print-state and uncomment it (comment out the following form instead).
21:41:11
pjb
paule32: clisp --version|grep -e '^libreadline' # should indicate the version of the readline library that is linked.
21:42:51
pjb
paule32: so to obtain the binary, you need to compile the source file. Unfortunately, with clisp, the debugger is way less effcient on compiled code than on interpreted code. So if you want to debug on compiled code, you should rather use ccl (or sbcl).
21:43:09
pjb
paule32: in any case, the advantage of using slime, is that you have the same debugger for all the supported implementations! sldb.
22:14:43
pjb
ebrasca: a good test to see if it's good, is to ask a student to make a modification or improvement to it, and see how easy he can do it.
22:17:47
aeth
Start a new Blockchain-based university and become the anonymous leader of that university. Qualifications are so 20th century.
22:22:48
aeth
pjb made a contribution to one of my projects once. trivial-left-pad, one of my first of April projects.
23:25:24
asarch
Hey guys, how would you open a big file, parse its content line by line and print the third column of every line that matches with a regexp?
0:20:07
Xach
didi: sorry not to have a useful answer - it would be nice if there was a library for your task. but it seems pretty complicated and i don't know of one.
0:24:00
didi
Xach: Nothing in particular. Just thought of it and realized I couldn't go earlier than 1900.
0:24:24
Xach
then perhaps investing in the great book "Calendrical Calculations" is not worth the trouble
0:29:24
Bike
i continually get confused reading mildly old russian things and being unable to comprehend julian dates
1:33:38
pjb
ym: the real world is part of the program: the universe is obviously a simulation written in your FP program!
1:35:41
asarch
Sorry if I insist. I promise this would be my last question but, how would you open a big file, parse its content line by line and print the third column of every line that matches with a regexp?
1:37:04
pjb
asarch: (with-open-file (stream "big-file") (loop for line = (read-line stream nil nil) while line when (regexp-match-line-p regexp line) do (print (third-column line))))
1:41:37
asarch
Actually, in the sed time I was looking for a decent programming language with OOP support
1:46:50
pjb
asarch: you may try: printf '((' ; psql --tuples-only --dbname="$DB" --user="$USER" --no-align --field-separator=')(' --record-separator='))'$'\n''((' --command="$QUERY" ; printf '))\n'
1:47:11
pjb
asarch: or rather: printf '(' ; psql --tuples-only --dbname="$DB" --user="$USER" --no-align --field-separator=')(' --record-separator='))'$'\n''((' --command="$QUERY" ; printf ')\n' # since it's big.
1:48:39
pjb
or perhaps: printf '("' ; psql --tuples-only --dbname="$DB" --user="$USER" --no-align --field-separator='")("' --record-separator='"))'$'\n''(("' --command="$QUERY" ; printf ')\n' # you may also have to modify the readtable, in either case, if any field contains double quotes or stuff…
1:50:14
pjb
asarch: you may also just use --html, and then parse the HTML. It may be safer, if psql escapes correctly < and > in the fields.
1:58:14
pjb
asarch: unfortunately, nowadays things are more complex. Youngsters can't respect nice conventions, such as writing a unix manual page. Instead, then write info page sometimes, or --help option to their commands.
2:01:01
asarch
For example, when I was learning Python I asked about how to put two commands in a single line
2:01:37
asarch
Since Python actually gets rid of the semi-colon punctuation mark to end a command just like Perl or C/C++ do
2:06:25
aeth
The only thing you need to know is man unless it's a GNU project, in which case the man just tells you to use info for the real information.
2:07:03
aeth
e.g. "The primary documentation of GNU Emacs is in the GNU Emacs Manual, which you can read using Info, either from Emacs or as a standalone program. Please look there for complete and up-to-date documentation. This man page is updated only when someone volunteers to do so."
2:10:22
aeth
Oh, great, the newest Firefox (48?) or something else seems to have no audio in StumpWM. Is anyone else getting this? It tells me to install PulseAudio, which is nonsense because (1) everything else still has sound and (2) Firefox on other desktops like KDE still has sound.
2:19:39
aeth
Looks like I now need to enable pulseaudio via systemd, even though I have never needed to do that before.
2:22:31
aeth
What's particularly strange is that the change in Firefox happened 6 versions ago but I'm only having the problem now.
2:29:39
aeth
Technically, I think it *is* a flaw in stumpwm because KDE has some way of working around this without me having to do something. I guess I can take it to the stumpwm channel, though.
2:30:55
didi
aeth: StumpWM is just a Window Manager. KDE is a whole desktop environment. They aren't comparable.
2:34:34
didi
Every time I use `multiple-value-bind' and I don't care about some variables, I dream of writing a macro that would discard NIL variables.
2:38:25
aeth
didi: Imo, they are comparable. The main difference is the lack of a StumpWM suite of applications (which means having to use a terminal, graphical file manager, etc., intended for a different desktop environment)
2:39:54
Bike
the point here would be that stumpwm doesn't have some DE workaround deal, since it just displays windows
2:41:30
didi
aeth: Taking your problem as an example, StumpWM knows nothing about sound, only windows. If you are running some kind of sound server, it wasn't StumpWM that started it.
3:33:12
whoman
other than symbols; paredit to working with lisp in emacs is what macros are to lisp, lets say
3:33:30
pjb
iqubic: as a lisp beginner, I would 1- use the CL implementation in a terminal during 2 days. 2- use the CL implementation in emacs (without slime) during 2 days. 3- use the CL implementation in emacs with slime during 2 days. and finally 4 use CL in emacs with slime and paredit for the rest of my life.
3:35:26
whoman
wrapping/unwrapping and moving left and right parens, are very nice features of paredit
3:45:33
Colleen
beach: drmeister said 8 hours, 22 minutes ago: Above I dumped the environment from within convert-elementary-setq (stored in cleavir-cst-to-ast::*debug-env*)
3:45:33
Colleen
beach: drmeister said 8 hours, 21 minutes ago: This is the environment when compiling one of the PUSH macros in this macro... https://github.com/drmeister/clasp/blob/cst/src/lisp/kernel/lsp/defmacro.lsp#L95 There is no mention of special-variable entries - so I think something is wrong with how the environment is being put together.
3:59:17
ghostyyy
hi, i have heard a lot about lisp macros, does anyone know any useful and practical examples of their usage?
3:59:57
ghostyyy
i googled it but i just get people talking about why macros are cool, ajnd not a lot of practical examples
4:01:25
ghostyyy
oh, i see! are clisp macros different from hygenic scheme macros in any appreciable way? i dont know clisp well, only scheme
4:01:33
beach
ghostyyy: Basically, macros allow the programmer to introduce syntactic abstractions, thereby making it possible to cut down on a lot of boilerplate code.
4:02:45
beach
ghostyyy: Common Lisp macros have the full language at their disposal in order to transform a form to a different form.