freenode/#lisp - IRC Chatlog
Search
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 ?
7:43:02
dmiles
I wanted to confirm that this is not some syntax that is used by any lisp other than EusLisp right? https://github.com/euslisp/EusLisp/blob/master/lisp/l/hashtab.l#L28-L141
9:00:28
pjb
dmiles: it's very hard to confirm such a thing. The probability that someone derived such a defmethod macro in a variant of eulisp or some other lisp or scheme is very high.
9:01:47
dmiles
well i was asking in order to figure out if there was some older type type or a special stylized non standard defmethod syntax i had not seen
9:03:46
dmiles
since of course people very rarely use defclass to define builtin classes.. except me and say EusLisp etc
9:04:53
dmiles
I was searching a few impls to see who defclassed hash-table that is.. and found EusLisp
9:06:17
pjb
dmiles: again, it is most probablye there are other macro with different syntaxes used to define classes and methods out there. There are more OO systems than programming languages…
9:07:11
pjb
dmiles: basically, take a scheme teacher and 100 or 200 students, and you get 200 different OO systems.
9:09:07
beach
dmiles: You can count on SICL using DEFCLASS to define the HASH-TABLE class, as well as the classes for SYMBOL, PACKAGE, etc.
9:14:23
dmiles
beach, right on, oh i now i see why i missed it on my last grep over impls.. it used defstruct.. (defstruct is just fine(
9:15:55
beach
I keep forgetting about DEFSTRUCT since I have absolutely no intention of using it in SICL code. :)
9:16:32
beach
And even if I *did* use it, it would have the absolute same representation as if I had used DEFCLASS.
9:17:45
dmiles
yeah in my impl DEFSTRUCT and DEFCLASS become the same representation .. jsut with DEFSTRUCT i create extra support of slot numbers
9:42:18
dmiles
rather than doing what i and many others do.. chekcing for environmental overrides and then going to symbol
10:07:32
beach
In fact, I save some space that way, because very few symbols will have a non-empty property list, so no need to represent them in the environment. In a typical implementation, this cell is allocated in every symbol, whether needed or not.
10:08:12
beach
The same thing goes for the function cell, the value cell, etc. In SICL, a symbol has only a NAME and a PACKAGE.
10:10:08
beach
I can even imagine some implementations having two function cells in every symbol, one for the name itself and one for (SETF <name>).
10:10:58
beach
Worse (in terms of maintainability), some implementations have a function cell for the name itself, but store the SETF name somewhere else.