freenode/#lisp - IRC Chatlog
Search
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
3:10:58
jmercouris
Xach: Might I suggest in the build script not requiring a bin directory for buildapp
3:11:13
jmercouris
I keep having to make a /my/path/bin, then moving buildapp out of there to /my/path
5:22:26
jmercouris
but if I write instead (defun print-something () (print *some-parameter*)) it will print the value of that parameter
5:22:37
jmercouris
here's the tricky thing though, (get-value) just returns the value of that parameter
5:23:49
jmercouris
I figured it was some strange closure optimization, but it could be a stupid issue
6:31:46
whoman
if you do not know what something is, how are you going to use it to help you <x> better ?