Search
Wednesday, 22nd of January 2020, 5:34:06 UTC
5:37:33
copec
How do I get quicklisp/asdf to look under the paths again without restarting lisp?
5:38:00
beach
Good morning everyone!
5:38:01
Josh_2
push paths to asdf:*central-registry* ?
5:41:02
ahungry
what does Sly offer over Slime?
5:41:12
Josh_2
#v syntax in repl which is SWEET
5:41:33
Josh_2
stickers as well, although I could never get that to work so I don't use them xD
5:42:07
Josh_2
ahungry: https://imgur.com/emlGBrJ.png
5:43:32
copec
There are obligatory animated gifs https://github.com/joaotavora/sly
5:45:09
ahungry
neat, what is #v syntax? Something like *1 and *2 in clojure/cider? (a reference to the last evaluated thing?)
5:47:57
Josh_2
it lets you reference repl values all the way up to when you started your session
5:48:04
Josh_2
I find it very helpful
5:50:29
ahungry
very nice, it is the same type of thing
7:04:24
pjb
AFAIK, there's only 1 sly user.
7:07:42
pjb
Josh_2: you mean in sly they deleted presentations?
7:20:12
pjb
Josh_2: since this slime features allows you already to refer to any previous result, they must have REPLACED it by #v?
7:21:59
no-defun-allowed
Well, they could have kept both, but presentations are cooler.
7:27:49
cl-arthu1
I think both presentations and #v syntax are present in sly, but not 100% sure.
7:29:21
no-defun-allowed
Though, I think there weren't presentations when I tried SLY.
8:57:38
pnp
Hi all. How is possible to move with Emacs + slime inside nested groups of parenthesis? If possible i would like to navigate Lisp code without using the mouse or the arrows keys
8:57:57
jackdaniel
pnp: check out "paredit" mode for emacs
8:58:15
pnp
yes...i installed paredit
8:58:21
jackdaniel
it may feel a bit quirky at start, but once your fingers get used to it it is a very useful aid
8:59:03
pnp
ok jackdaniel, i'm reading here: http://wikemacs.org/wiki/Paredit-mode
9:01:28
pnp
now if i'm looking that there is the go up command C-M-u but i don't find the command to do the inverse
10:10:00
shrdlu68
I want to iterate over a range of integers while skipping some. Would using the series package be more efficient than a simple loop?
10:10:56
montaropdf
Wouldn't it be better to first filter your list with something like remove-if?
10:12:58
phoe
shrdlu68: (loop for i in list when (foo-p i) do ...)
10:13:20
montaropdf
phoe: that works too ;)
10:13:22
phoe
where FOO-P is a predicate that returns true if the number should be iterated on
10:13:43
shrdlu68
Language fails me - I meant more like collect.
10:13:59
phoe
shrdlu68: (loop for i in list when (foo-p i) collect i)
10:14:06
phoe
where FOO-P is a predicate that returns true if the number should be collected
10:14:23
shrdlu68
Sure, but would using the series package be more efficient?
10:14:34
phoe
oh right - you've asked that
10:14:48
phoe
no idea - I haven't used SERIES at all
10:16:38
shrdlu68
I suppose I have to test it myself.
10:47:47
capitaomorte
Hello all. My friend Arthur tells me there was some SLY questions here. I can answer a couple if you wish.
10:49:42
phoe
A user named ahungry had some sly questions, but they left
10:51:47
capitaomorte
Thanks. If you see him/her, please tell him it's ok to open simple question issues on github.
11:04:45
ioa
Hi lispers. Three more weeks to paper submission deadline for the ELS2020: https://european-lisp-symposium.org/2020
11:20:33
beach
ioa: Thanks for the reminder. I'm on it! :)
13:20:13
pjb
minion: memo for emaczen: ARM Assembler in Lisp http://www.ulisp.com/show?2XZH
13:20:13
minion
Remembered. I'll tell emaczen when he/she/it next speaks.
13:49:32
beach
Nilby: If you want to be acknowledged for helping me find information about SBCL breakpoints, I need to know how you would like your name to appear. You can give it here, or send it by email.
13:57:10
Nilby
beach: Thank you, but I don't like to be acknowledged. You can take any credit.
14:00:42
asdf_asdf_asdf
Hi. How coerced value from (read) to type alien?
14:04:57
ck_
asdf_asdf_asdf: I think you just try to coerced value as best as you can. But more seriously, this sounds like a question for #sbcl.
14:51:59
refpga
Hello, how does one send whois queries using lisp?
14:53:45
dlowe
one looks up the protocol and uses a network socket library (like usocket) to implement the protocl
14:53:53
Xach
refpga: one easy way is (run-program "whois" string)
14:53:58
dlowe
iirc, the protocol is actually pretty simple
14:54:07
pjb
(uiop:run-program "whois foo" :output :string)
14:54:25
dlowe
one word of warning: they clamp down hard on automated whois queries
14:54:42
dlowe
I have an ip address that I think is just permabanned from whois servers.
15:55:08
jmercouris
can someone please remind me how to break from a loop and return the element that is true for some predicate?
15:56:05
Bike
"when (predicate thing) return thing"?
15:56:14
jmercouris
is there not another form?
15:56:26
jmercouris
is it just (loop for element in list when (predicate x) return y)?
15:56:41
Shinmera
but it won't return the element, if I remember correctly.
15:56:47
jmercouris
FIND-IF... that could be a good idea
15:56:56
jmercouris
but I don't think I can find-if across a hash table
15:57:01
Bike
Oh, if that's the entire loop you could just do (some predicate list)
15:57:06
Bike
find-if doesn't work on hash tables, no
15:57:40
jmercouris
Bike: what is (some-predicate list)?
15:57:40
Bike
and thereis apparently does return the element, so that works too, but it'll be the value returned by the predicate.
15:57:44
specbot
http://www.lispworks.com/reference/HyperSpec/Body/f_everyc.htm
15:58:07
Bike
no wait, i thought that returns the element but it doesn't
15:58:22
Bike
forget my own head next...
15:58:48
Bike
so yeah, probably the first thing i said. unless that's a problem for some reason?
15:58:48
jmercouris
let us say this, how to go through values in hash table and check for predicate and return first value that matches
15:59:02
Bike
you can loop over a hash table with loop
15:59:02
jmercouris
so, is what I said true then?
15:59:06
Bike
though i can never remember the syntax
15:59:17
Bike
loop for x being the values of table, or something
15:59:19
jmercouris
same, but I have an example
15:59:31
galdor
CATCH + MAPHASH + THROW should work
15:59:34
jmercouris
and you can do when (predicate-x x) (return element)?
15:59:39
galdor
LOOP + RETURN if you can remember the syntax
15:59:58
jmercouris
let me just try with a simple sequence first
16:00:16
Bike
"when (predicate x) return x". return is a loop keyword
16:00:30
jmercouris
OK that's basically what I was trying to figure out
16:00:33
galdor
generally speaking, if you need to regularly find a specific value in a hash table, I'm not sure the hash table is not the right data structure
16:00:43
jmercouris
it is rare that I have to do so
16:00:47
Bike
you could also do "when (predicate x) do (return x)"
16:00:54
jmercouris
it is for a sanitation function that checks the state of the objects in the hash table
16:01:07
jmercouris
Bike: would that not keep looping though?
16:01:19
jmercouris
or does (return x) break?
16:01:21
Shinmera
you can also just 'do (when x (return y))' like anything else.
16:01:32
jmercouris
ah, OK, thank you all
16:03:12
Bike
i recommend going through and macroexpanding a loop some time
16:03:25
Bike
your implementation will go and put in a bunch of weird shit, but usually you can get it down to a simple form
16:03:33
Bike
makes loop much less mysterious
16:04:19
jmercouris
I will try to do that
16:05:18
Bike
though it might still be kind of weird in the end with hash tables, since with-hash-table-iterator is kind of weird.
16:56:29
asdf_asdf_asdf
Hi. How get type from var in Common Lisp?
16:56:47
beach
Variables don't have types. Objects do.
16:57:02
asdf_asdf_asdf
:type (type-of obj)
16:57:28
beach
So what is it that you want?
16:57:59
beach
Most objects can have many types, some even an infinite number.
17:00:39
sjl_
*every* object can trivially have an infinite number of types of the form `(or actual-type (member 1 2 3 ...))`
17:00:55
asdf_asdf_asdf
(alien-size (type-of ptr) :bytes) ; error
17:01:29
jmercouris
is asdf_asdf_asdf fare?
17:02:12
beach
asdf_asdf_asdf: I strongly recommend that you program in Common Lisp instead.
17:03:38
Nilby
I'm thankful that everything is of type T.
Wednesday, 22nd of January 2020, 17:34:06 UTC