freenode/#lisp - IRC Chatlog
Search
15:14:17
phoe
KZiemian: I think it refers to data stored in a tree structure, where you have nodes that can point to other nodes without cycles, and leaves are the nodes that do not point to anything.
15:36:33
pagnol
there's a library I would like to use (https://github.com/heegaiximephoomeeghahyaiseekh/lisp-binary) but for some reason ql:quickload gets stuck during compilation
15:46:03
zazzerino
pagnol: I'm also on debian stable, and would recommend https://github.com/roswell/roswell for this task
15:56:00
phoe
yep. AFAIK there are workarounds, look on the github page of the project, in the issues.
15:57:59
zazzerino
Looks like an interesting library. I tried loading it in quicklisp and have the exact same issue (quickload hanging while loading [package lisp-binary]. Sorry, I don't have a solution, but it's not just your machine!
15:58:34
zazzerino
Also, looks like the main dev opened an issue about a month ago with the title "Dependencies are fucked" lol
15:59:26
phoe
zazzerino: it's not QL hanging. It's SBCL running out of heap space while compiling it.
16:00:55
zazzerino
phoe: yeah, I think you're right. I just meant "ql:quickload" was the function I was running to load the library (which was in my local-projects dir)
16:15:00
zazzerino
maybe try ccl? if you've installed roswell it should be as easy as "ros install ccl" and I think "ros use ccl"
16:26:42
beach
ebzzry: When it looked like the xxx-if-not family was going to be removed (because of being deprecated) complement would have been more useful. But then, most people now agree that they are undeprecated.
16:41:03
Xach
An implementation may choose not to signal this error for performance reasons, but implementations are forbidden from defining the failure to signal an error as a useful behavior.
17:00:17
pjb
ebzzry: you have to distinguish two cases: #'foo where foo is a symbol exported from CL and #'foo where foo is not exported from CL.
17:04:59
pjb
11.1.2.1.2 points 2 and 3 (the exceptions deal only with flet/labels), mean that the implementation is free to fbind symbols exported from CL.
17:06:45
pagnol
phoe, zazzerino, jackdaniel on #sbcl suggested I run sbcl with --dynamic-space-size=8192, and it worked
17:14:18
pagnol
being new to lisp I had to google to find out what this refers too and am reading http://wiki.c2.com/?SmugLispWeenie
17:27:52
drmeister
I'm writing allocation profiling code for Clasp - is it better to keep track of the total memory allocated or the number of allocations?
17:28:56
drmeister
It seems to me the number of allocations is more valuable - there's overhead associated with each allocation.
17:33:50
Colleen
Bike: drmeister said 10 hours, 42 minutes ago: bclasp seems rock solid now - no more exception handling problems that I can see.
17:33:50
Colleen
Bike: drmeister said 10 hours, 40 minutes ago: It was a very, very longstanding problem in the WITH-TRY macro when an exception bubbles up the stack.
18:19:19
oisjdfoasidf
https://pastebin.com/61SjuyYV I get "*** - CONCATENATE: #\a is not a SEQUENCE", help?
18:20:22
oisjdfoasidf
I am brand new to lisp (coming from years of Python experience), and finding it very hard to get used to lisp. trying to write basic hangman game..
18:21:35
beach
oisjdfoasidf: IF in Common Lisp is a form with a value, so you can write: (setq result (concatenate 'string result (if (find c guesses) x y)))
18:21:53
pjb
oisjdfoasidf: but more probably, you'd want to use a functional expression, not a procedural one!
18:22:17
beach
oisjdfoasidf: Only in languages where IF is a statement must you duplicate the (setq result (concatenate 'string result ....))
18:22:19
pjb
oisjdfoasidf: also, your function doesn't do I/O, so don't include "PRINT-" in its name!
18:23:19
pjb
(defun current-matches (word guess) (map 'string (lambda (word-char guess-char) (if (char= word-char guess-char) word-char #\-)) word guess)) (current-matches "apple" "ajkle") #| --> "a--le" |#
18:25:12
pjb
(defun revealed-word (word guesses) (map 'string (lambda (word-char) (if (find word-char guesses) word-char #\-)) word)) (revealed-word "apple" "ajklexyz") #| --> "a--le" |#
18:32:03
AeroNotix
Shinmera: Just asking. I see you and baggers chatting often (in his stream etc) and you are working on different but similar things. Just think it's interesting
18:32:52
AeroNotix
I usually don't watch streams because they're too slow and end up waiting til they're on youtube so I can put them on 2x or 3x speed
18:33:16
AeroNotix
not that the content isn't interesting, https://www.youtube.com/watch?v=_DjEK3DMY_0 I'm watching this right now
18:34:01
AeroNotix
no experience with anything like this. I find CEPL tricky to just "get started" in it.
18:35:34
Shinmera
Getting into graphics stuff is tough. There's a lot of crap to learn up front before you can get anything done.
18:36:00
AeroNotix
yeah exactly. I'm a proficient programmer and have been programming for years but there's something about graphics libraries that seem so daunting
18:37:17
AeroNotix
It'd be good if for people's games libraries they literally made an example game which had you move a square inside a box.
18:38:29
Shinmera
For Trial there's https://www.youtube.com/watch?v=0v6iv_3BLeo, but it is pretty detailed (and slightly out of date by now)
18:38:48
Shinmera
So I don't know how helpful that would be. Honestly can't recommend anyone to get into it right now that doesn't want to just do engine work.
18:39:13
aeth
My nowhere-near-complete engine has an examples directory. I'm done developing the API when the examples are elegant. Very useful for me to have. I'm sure more complete projects have the same idea.
18:39:26
AeroNotix
It's amazing watching these streams, going from drawing a ground/wall tile to having it appear in a game and then loading up sprites that then shoot seems so simple. But you're clearly familiar with the API.
18:42:20
aeth
It's hard to tell what's out there because the line between library, framework, and engine is blurry
18:42:53
AeroNotix
aeth: it's not just a CL problem, there's TONNES of graphics libraries and related things to use. Kind of paralysing if you want to just jump into something
18:45:53
aeth
AeroNotix: (1) It's complicated enough for many different abstractions to make sense but not complicated enough to seem impossible, (2) most things wind up being outdated and it's easier to NIH than to update an older library
18:46:33
Shinmera
I've always had the bad habit of writing more engine than application code, so here I am never getting any actual games out
18:46:44
aeth
But #2 mostly doesn't apply to Lisp. It only has a few heavily-outdated libraries. It explains a few things, though, like cl-glfw vs. cl-glfw3
18:50:02
Shinmera
The closest to an actual game was Shirakumo's last LD entry: https://ldjam.com/events/ludum-dare/39/rush
18:54:13
aeth
I intentionally don't release things, although I'm getting closer to 70% or so of a basic game (ignoring some ignorable things like sound for now). Anything released would become a maintenance nightmare if the API isn't final. I suspect many others are in a similar situation.
18:58:34
aeth
itch.io hosts Lisp game jams regularly (where "Lisp" there means "the Lisp family", but it's mostly Common Lisp). e.g. https://itch.io/jam/lisp-game-jam-2017-easy-mode/entries
19:07:35
phoe
AeroNotix: I have already managed to succeed with the parsing, thank you for the offer though.
19:09:13
Xach
I had a macro IN-ANONYMOUS-DIRECTORY that would make a temporary random directory, set *d-p-d* to that directory, evaluate a body, and then clean up the directory.
19:09:48
Xach
but I had a typo and had something like (in-anonymous-directoryk (write-report *default-pathname-defaults*) (upload-report *default-pathname-defaults*)))
19:10:48
Xach
and evaluation rules meant that each part of the body ran. but it started publishing way more stuff than i wanted.
19:11:41
Xach
i actually lucked out because i had an encoded pathname and it broke the request signature
19:12:23
Xach
Back in ye olden times, people sometimes did "touch ./-i" to force rm to be interactive.
19:13:08
pjb
Well, I was bitten by: rm -rf ${DIR}/${SUBDIR} ; tested well under user accounts, but under root, DIR and SUBDIR were empty!
19:14:38
AeroNotix
something off topic but I hate how slack downloads snippets with the filename "-.txt"
19:56:56
jmercouris
I see that you can name your own markup you like via :markup to any value supported by pandoc
19:57:30
jmercouris
The only question is, for things like images, how do you like them let's say if you are using emacs org mode, will it be smart enough to see a link to the static dir and make an appropriate link?
19:59:56
knobo
I'm using websocket-driver, and I need to keep som extra data in the websocket object. I could extend the class, and do a change-class after it is created.
20:01:40
knobo
Is that the library has it's own make-websocket-class function that does some initiation.
20:04:01
knobo
the wsd:make-server does some things to the object that is returned to me.. (apply #'make-instance 'server .......)
20:14:42
malice
knobo: Why do you need to keep the data in the websocket object, and why couldn't you for example wrap the object in other object?
20:16:13
knobo
I can not keep it in the session object, because a user can be connected with several browser windows, and multiple connections in same window.
22:12:04
Shinmera
::notify jmercouris Cause it's a place to hang out with friends and chill on the weekend.
22:26:00
Shinmera
Tired because it's late, stressed due to upcoming exams, and salty as I had a losing streak in Splatoon a while ago.
22:27:28
antoszka
iqubic: lisp supports any notation you tell it to use, but usually you'll use the built-in one, which is mostly prefixy
22:27:29
iqubic
Even for mathematical operators? You only get prefix notation? Like how do you compare numbers?
22:28:19
knobo
hmmm. It's like asking permission from my parents, "May I please use the change-class, mom? Please.. Just once. Ahhh... come on! That's not fair.. Ok, then. thanx" :P
22:31:40
antoszka
I'm totally not suggesting lisps are the only languages that support zero-argument arithmetic functions.
22:32:50
aeth
iqubic: (+ foo) returns the value of foo if foo is a number, (- foo) negates the value of foo. (* foo) also returns the value of the number. (/ foo) gives the same result as (/ 1 foo)
22:33:36
aeth
- and / are trickier because they don't have a 0-value form and their 1-value form is less expected than + and *
22:35:09
antoszka
iqubic: The lambda list specification is rather rich in Common Lisp it might take a while to sink into.
22:36:20
aeth
iqubic: map is probably more useful than mapcar because it works on any sequence and can return any sequence, e.g.: (map 'string (lambda (c) (code-char (- (char-code c) 1))) "Ifmmp-!xpsme\"")
22:37:43
aeth
Oh and people who are using EBCDIC-based Lisps will forever wonder what message I was trying to send.
22:38:54
antoszka
iqubic: there are just some keyword arguments that specify which part of the list to extract for processing.
22:44:19
aeth
(characters are a type that can be converted to/from a number with char-code/code-char; that's implementation-specific, but the ASCII range is probably portable over every currently-alive implementation)
22:45:23
aeth
The weaknesses here are different character encodings (fortunately, Unicode has mostly won) and different types of sequences (e.g. doubly linked lists, typed lists, lazy lists, etc.)
22:46:34
aeth
there is no default for make-sequence, you have to give the result type, like with map
22:48:14
aeth
You'd use vector or make-array for the first category and list or make-list for the second, with string and make-string as unnecessary but useful (you can just make-array with a :element-type 'character instead)
22:49:01
antoszka
iqubic: The “typical” sequences you'll get to deal with in CL would probably be lists (obviously), strings and 1-or-more dimensional arrays.
22:49:02
aeth
Code that works on all sequences will probably have two completely different implementations, one for vectors and one for lists. It might have more than two if it wants to be very efficient, e.g. implementations of map probably have many versions
22:49:59
aeth
With sequences and numbers, type information can make your code very efficient because if the compiler knows the type, it can skip runtime dispatch based on type.
22:51:24
aeth
antoszka: Unfortunately, multi-dimensional arrays aren't sequences. A lot of the time treating them as sequences would actually be useful.
22:53:15
aeth
Multidimensional arrays and multiple return values are neglected in the standard. Any code that uses either heavily is probably going to reinvent a lot of the same macros and functions.
22:55:16
aeth
_death: (map 'matrix (lambda (x) (* x 1)) some-matrix) would have been so much better than the many ways you can currently work around that limitation. Although the actual flat order is possibly implementation-dependent, so it would mostly be useful for pure functions on one 2D array.
23:23:28
pagnol
I have a byte vector and would like to get a stream as though I had used with-open-file and (unsigned-byte 8) as element-type
23:25:57
pjb
I can't understand how people who use sbcl and specialized vectors "for speed" are the same who use flexi-streams…
23:27:33
pagnol
I'm messing around with the lisp-binary library and unless I missed something, then the function read-binary only takes streams
23:29:54
aeth
pagnol: You can define a custom stream with trivial-gray-streams. All you would need to do is inherit from fundamental-binary-output-stream and/or fundamental-binary-input-stream and define the proper methods
23:30:40
_death
you could hack flexi-streams to support sharing so it doesn't need to subseq.. if it's still as according to my notes from years ago
23:33:06
aeth
Making a stream with trivial-gray-streams is very concise. Your implementation will probably be < 30 lines.
23:37:11
pagnol
now I get an error from flexi-streams saying my sequence can't be decoded using utf-8... why the heck is it even trying to do that?
0:26:35
dieggsy
Is there anything _like_ hy but that is a proper scheme/CL or scheme/CL compliant? That is, a scheme/cl for interacting with Python. Hy is neat, but some of its syntax is... odd
0:33:14
dieggsy
Shinmera: heh, cool nonetheless! (and yeah, i kinda would expect it to be a scheme for some reason, but to my knowledge no such thing exists)
0:58:48
fiddlerwoaroof_
pagnol: is this what you want? https://github.com/fiddlerwoaroof/vector-update-stream
1:00:21
fiddlerwoaroof_
https://github.com/fiddlerwoaroof/vector-update-stream/blob/master/stream-to-vector.lisp#L103
1:01:35
fiddlerwoaroof_
It's under the same license as flexi-streams (BSD-2-clause), so you should be able to use it with anything
1:02:35
fiddlerwoaroof_
I think I wrote it by taking some code from flexi-streams and modifying it a bit, because flexi-streams didn't really expose this kind of functionality: it generally assumes that the stream "owns" the underlying vector.
1:06:25
Colleen
jmercouris: Shinmera said 2 hours, 54 minutes ago: Cause it's a place to hang out with friends and chill on the weekend.
1:10:04
pagnol
fiddlerwoaroof_, I found out though that flexi-stream:with-input-from-sequence does the job too
1:11:06
pagnol
when I first used I got an error from flexi-stream, so that I assumed I had used it incorrectly... but it turned out that the error originated from somewhere deeper in the stack and I had used it correctly
1:11:35
pagnol
because the library I'm using (lisp-binary) also relies on flexi-stream for some of its functionality
1:12:19
fiddlerwoaroof_
I remember evaluating flexi-streams when I wrote that library and finding that something didn't work quite the way I wanted
1:12:40
fiddlerwoaroof_
But I forget the details now, I suppose I should have documented it in the readme \_(;/)_/
1:56:32
Xach
It has some problems. I wish the multiplatform support was better. I have a plan to improve it but not the time.
1:56:57
jmercouris
every company says "we care about open source" but I've not seen a dollar of their investment into it
1:57:38
jmercouris
I wish I could support the community more, monetarily at least, the skills I don't have
1:59:10
jmercouris
I'll just throw this out there in general, if anyone in this community needs someone to talk to, I'm always happy to listen
2:07:06
aeth
jmercouris: Software companies should require that any hours of developer work beyond 30 in a week go to open source projects. This could help prevent burnout. (This could include Creative Commons and cover some non-programming roles, too.)
2:07:57
jmercouris
I'm hoping that nEXT can one day be an open source company that actually gives back to the community
2:08:26
aeth
jmercouris: Then you can comply with my proposed rule while overworking your developers with 90 hour weeks! Perfect!
2:09:24
jmercouris
full time work as a professional engineer + 2x as many classes as a normal student + moving to a new country + research publications simultaneously + many family health issues = not a good time
2:10:16
jmercouris
and I hope to help others as well, I want everyone to just feel happy, and safe, and relaxed