freenode/#lisp - IRC Chatlog
Search
12:48:47
jackdaniel
you put the prompt after them and press backspace repeteadly until all parentheses are deleted
12:51:53
random-jellyfish
I just want to delete the pair of parentheses that encloses the content, but not the content
12:53:45
jmercouris
random-jellyfish: you could use paredit to do that, though I believe it has problems in the REPL
12:54:41
jackdaniel
here's how I do that: I put prompt after the expession enclosed with parens, I press backspace and navigate after the first paren
13:05:17
jmercouris
shka__: slime-scratch? can you expand on that? a google search yields gibberish results
13:06:37
shka__
it is like emacs scratch buffer but instead of evaluating emacs lisp it is for evaluating common lisp
13:22:19
jackdaniel
while I'm sure many people would be delighted to have it I wouldn't load such contrib myself, hence loading it by default may be a bit problematic (for me)
15:34:55
random-jellyfish
I get error ; in: DEFUN DICE2 ; ((RANDOM 6) (RANDOM 6)) ; ; caught ERROR: ; illegal function call ; ; compilation unit finished ; caught 1 ERROR condition WARNING: redefining COMMON-LISP-USER::DICE2 in DEFUN
15:38:02
dlowe
if you use VALUES, your function will return two numbers. Calls that don't expect two numbers will only get the first
15:39:52
dlowe
It's literally that functions can return more than one result, without wrapping it in a intermediate structure
15:40:24
dlowe
it's more akin to returning a tuple in python and then doing a deconstructing assignment
15:43:02
dlowe
You can do the analogous thing in CL with (destructuring-bind (a b) (list 1 2) ...) but it's not as useful
15:43:28
jmercouris
is there a way to recompile a defpackage form after you've removed some symbols you previously exported?
15:45:05
jmercouris
somehow adding exported symbols is OK, but if you delete some, SBCL loses its mind
15:46:14
Bike
this also applies to other package alterations sbcl complains about. nothing defpackage does is impossible to do outside of defpackage
15:47:35
jmercouris
maybe it would be another style to export symbols directly after they are defined
15:47:59
jmercouris
like if they have a defun they want to export, they have the export right next to it
15:48:24
sjl_
cl-annot does something like this. I don't personally like it, but I guess some people do https://github.com/m2ym/cl-annot
15:51:38
sjl_
I personally prefer the one-big-package.lisp-file approach. I like that it makes you lay out the API of each package explicitly in a single place. I like that I know where to go to see a quick overview of a package's API, rather than having to grep through source files for `export`
15:53:37
jmercouris
I do that usually, but I'm working with a caveman2 skeleton project and trying to understand/adapt to Eitaro's style, I may just nix it in the end and go back to the package.lisp approach
15:54:43
jmercouris
its just that before I completely discount something, I like to at least try it and understand
16:04:17
markasoftware
i have an array of :element-type 'boolean. However, each element is taking up many bytes of memory (maybe 8?) in sbcl. Is there any way to decrease this memory usage to 1-2 bytes per element?
16:06:39
sjl_
not if you want to keep the elements as booleans. A boolean in CL is one of the symbols T or NIL, SBCL uses a pointer to refer to the symbol.
16:07:55
aeth
I use bits with (zerop foo) and (= 1 foo) and flip the bit with (if (zerop foo) 1 0) etc.
16:08:28
aeth
I guess there's nothing stopping an implementation from using booleans and storing them as bits, and wrapping every access in a conversion, but I don't think any do.
16:15:56
sjl_
I'm sure it's possible, but yeah, I don't think any implementations do it. Generally if you say "I want to store X" it will use a scheme that actually does store X.
16:16:09
Xach
markasoftware: a bit vector would be more compact in memory at the cost of some interpretation of the values as booleans.
16:43:39
aeth
Yeah, I use bit vectors in my prime sieve which is used for quite a few Project Euler problems. And that's a place where bits-over-booleans really, really matter.
16:44:27
aeth
I could probably cache the primes, but then that would go against the spirit of trying to do things in < 1 second if possible.
17:22:40
sjl_
Yeah, for Euler I sieve and store the primality of the first 100 million odd numbers in a bit vector, and use miller rabin to check primality for numbers larger than 200000000
17:27:48
aeth
Interesting. I turn my sieve into a simple-array fixnum afterwards. Maybe I should hold onto the intermediate bit vector somewhere.
17:32:59
sjl_
There are ~11,000,000 primes below 200,000,000. With an array of (unsigned-byte 64) that's roughly 80mb to store them all. If you store the odd numbers below 200,000,000 in a bit vector that's ~11mb, and lookup is (aref v (ash n 2))
17:34:56
sjl_
But I still think the bit vector method uses less space, and the lookup is O(n) instead of O(log(n))
17:38:48
sjl_
honestly now that I have a machine with 64gb of RAM I should probably be a little less stingy on the precomputation. Though mostly it's annoying that it takes a while to quickload the system. I should probably make it so the primality array gets compiled into the FASL so it can load without recomputing it every time.
17:43:33
sjl_
friend code 48257_AAgoR50jsmK1HqPwtcQJZV9iqzIuk6ay if any other Lisp people do Project Euler
19:20:41
blackswan
because that's the number of apparently unique repositories referenced on the first two pages when i search for "tetris lisp"
19:54:51
aeth
If I wrote a falling tetromino game I would make sure that no one confuses it with Tetris®, the property of the notoriously litigious The Tetris Company
20:00:31
blackswan
i would not, because nobody cares about mine. i think i wrote three of them in the 80s. one was for the symbolic lisp machine.
20:13:37
dmiles
well i am trying to build cloak right now (i think you were as well once) and you wondered about if sb-heapdump was working.. sinc ethat ius what cloak uses
20:15:40
dmiles
2018-01-10T15:02:33Z karlosz: do you happen to know if sb-heapdump is still working?
20:16:13
karlosz
dmiles: i have no idea what cloak is. i am pretty sure i was working on some sbcl internals related thing
20:17:10
ober
(CFFI::TRY-FOREIGN-LIBRARY-ALTERNATIVES THNAPPY::LIBSNAPPY ("libsnappy.so" "libsnappy.so.1" "libsnappy.dylib") NIL) what would keep sbcl from finding a lib that exists in /lib, /lib64, /usr/lib, and ldconfig has been run.
20:28:12
dmiles
ok found a way to get it https://repo.or.cz/sbcl/lichteblau.git/snapshot/HEAD.tar.gz
21:17:04
mgsk
Does anybody recall the package that makes presentation slides? I seem to remember a cool one floating around recently, where you could interactively change the slideshow as you presented.
23:36:32
Colleen
Oladon: no-defun-allowed said at 2018.10.04 07:57:01: I put up the code on https://gitlab.com/theemacsshibe/mboard, it's very messy and bad so you get all the loose parts under WTFPL
23:37:35
Colleen
no-defun-allowed: Unknown command. Possible matches: 8, set, say, mop, get, time, tell, roll, help, deny,
23:38:30
no-defun-allowed
It shouldn't be too hard to make persistent, if you use a wrapper like Postmodern and you probably should change the software to use usernames the users chose and passwords.