freenode/#lisp - IRC Chatlog
Search
18:06:33
didi
So I have a priority queue which shuffles objects around. I want the objects to know their indexes inside the priority queue, but I also want the priority queue to hold any object. So I declared a class IDX-CLASS with an object slot called IDX. How do I set IDX only of objects that are instances of IDX-CLASS? In my solution, I declared a generic function SET-IDX and 2 methods: (defmethod (i (x idx-class)) ...) which sets IDX, and
18:09:56
Bike
usually instead of set-foo you should just define a setf method, but since it doesn't always set it this makes sense.
18:10:00
|3b|
ACTION might just define accessors to do nothing instead of making a separate function
18:10:45
|3b|
or calculate it when you read it, if that happens less often than moving things, then it works for everything
18:20:39
didi
I want to keep track of indexes because I want to efficiently change objects' priority, so I can call (increase-priority i queue) instead of linear searching for it and then increase its priority. Does anyone have a better idea for keeping track of priority queue indexes? Maybe a priority queue algorithm that doesn't need it (I am using a heap)? I am uncomfortable with the priority queue functions changing values of elements it holds.
18:22:22
didi
|3b|: My heap implementation uses a vector. So it is the index of the object on this vector.
18:26:49
|3b|
ACTION 's first thought is just to have a separate hash table as an index, not sure if that is actually good or not though
18:32:09
mfzap
hi all... anyone know the easiest way to grab the socket remote IP address for an inbound request in WOOKIE (runs sockets via CL-ASYNC which is via LIBUV)?
18:52:26
aeth
jackdaniel: (setf cffi::*cffi-ecl-method* :c/c++) doesn't seem to change the issue. render-entities (which calls all the draw calls) runs at 0.028471, which is more than the 0.016666... that is allowed for 60 FPS
18:53:05
aeth
I don't think it's a cache error because it recompiled everything after I made that change, starting at the gl file.
19:03:18
aeth
Actually, this doesn't appear to be the case. It probably has to do with the cache of compiled files.
19:17:42
aeth
The actual individual draw call is 0.000014, which is still about twice as slow as SBCL's and CCL's (I'm getting 0.000007 now for SBCL, yesterday I got 0.000009 for both SBCL and CCL iirc)
19:21:29
aeth
(The reason I accidentally thought nothing changed is because I saw SLIME recompile my engine's files... when, of course, it needed to recompile the cl-opengl bindings in order to make a change.)
21:32:10
msmith
anyone know if there is a way to append a stream to a broadcast stream after it is created?
21:40:44
|3b|
or if the stream needs to stay constant, maybe use a synonym stream pointing to a broadcast stream and swap it out with another broadcast stream with the extra stream
21:45:47
msmith
|3b| just read up on synonym streams and can't really see the point in them. Are they mainly used for the kind of use case you described? to be able to do something the the stream it points to while data is moving through the synonym stream?
0:30:27
sausages
in SLIME's 'all functions that call this function' feature, is there some option somewhere that tells SLIME not to kill the buffer whenever I select one of the listed functions?
0:47:14
BusFactor1
The Interpretation and Compliation of Nock Programs (in Common Lisp) #Urbit https://gist.github.com/BusFactor1Inc/e85dbd369bb5fdb67644a75e65a71c12
1:04:49
whoman
sausages, i have a feeling there is a general emacs way to do this, like C-u, but i do not know it
1:41:45
axion
pjb: SYMBOL-PACKAGE was what we needed. This problem that has plagued us for 3 years is finally solved. Thank you very much for your input.
4:16:45
John[Lisbeth]
what is the lisp equivelent of tail in haskell where you fetch the tail of a list
4:19:25
beach
whoman: You realize that John[Lisbeth] has been learning Common Lisp for almost 2 years, right?
4:20:34
beach
15.07.26:10:31:22 <John[Lisbeth]> I am on the learn lisp the hard way website, and I can't get to the next page in the tutorial
4:23:14
whoman
sorry i do not know what to say, there are some really simple and common things that not everyone learns at the same time as others.
4:23:49
John[Lisbeth]
and I often program mutably so I am not processing lists as much as arrays and hash tables
4:24:25
John[Lisbeth]
Though right now I am programming immutably and I have a function that takes arbitrary arguments and I have a list of values and I want to feed that function the list of values as it's aguments
4:25:32
axion
i tend to use cdr when dealing with cons cells, and rest when dealing with lists, as a means to help self-document my code.
4:35:04
emaczen
What advice do you all have about "passing along" errors i.e. a handler gets invoked which then determines some state information and then calls error again with a new condition -- is this strange or common?
4:42:50
emaczen
axion: to be clear, I have a handler-bind which invokes a restart, and then the restart calls a method which checks some state and then calls error with a condition determined by the state that was checked -- that sounds like 'resignaling,' is this normal?
4:48:12
emaczen
axion: alright, I think I might see a simplification -- at least I'm not doing something ridiculous or crazy haha
4:49:08
emaczen
this is my first time using the condition system non-trivially, I think I am understanding the finer modularity of it as contrasted with traditional try/catch
4:50:48
beach
Exception handling is broken in most languages other than Common Lisp. Multics PL/I is one exception.
4:51:44
axion
I love seeing people use/learn CL's condition/restart system. It is far under-used, nd beach is 100% right.
5:01:01
emaczen
Bike: Yeah, I think I see what I can do with it now -- I put some print statements and some breaks in my restart-case and handler-bind forms
5:02:17
emaczen
Bike: my answer to your previous question is that my condition doesn't have any information in it to recover from, but the parent-scope does, so I can pass that information to the restart
5:07:20
emaczen
Beach: What about more purely functional languages that have those Monads for error handling? How does that compare?
5:08:22
emaczen
I can barely remember a Try Monad, and it was like "wrapping" around a value, or there was also a Maybe Monad, and you wrapped it around a value too.
5:08:27
Bike
you can use them for continuations, so you could have something like the lisp condition system
5:09:28
Bike
a long time ago a haskell programmer told me they don't like restarts because they kill referential transparency
5:09:58
loke`
Bike: Yeah... because RT make sit soo easy to make an application that actually does useful work...
5:12:43
John[Lisbeth]
Bike (eval (list 'defun 'foo () 2)) http://i2.kym-cdn.com/photos/images/original/000/913/758/a12.jpg
5:13:42
Bike
yes, and i responded with "what", as to indicate my lack of understanding of the sound (or script) so produced
5:16:26
John[Lisbeth]
Thats what happens when support channels try to lie to me is I slowly figure out they are lying and circumvent their best practices
5:17:44
Bike
and everybody uses https://en.wikipedia.org/wiki/Lie-to-children because explaining arithmetic through peano wouldn't work and doesn't have much to do with actual practice
5:18:17
Bike
but if you're going to be hostile and reject help for like, three years on end, then it would be best for everybody if you fucked off
5:21:02
Bike
and if you actually need to define a function with a variable name it would be better to use (setf fdefinition) than eval.
5:26:20
emaczen
Chemistry is probably one of the worst examples with all of those strange bonding rules and then they tell you ohh it doesn't really work like that.
5:27:57
emaczen
my opinion would be that lie-to-children is probably more confusing to children (but I was/am more literal)
5:33:47
John[Lisbeth]
I wouldn't call it help I would call it only answering a small piece of the question and if that piece isn't the solution then insist someone reads an entire book on lisp which I simply wont doe
5:35:38
Bike
the obvious conclusion is you could have saved everybody a whole lot of time, including yourself
5:35:57
John[Lisbeth]
I don't see it as a whole lot of your time I usually only ask a handful of questions every year
5:36:57
flip214
John[Lisbeth]: learning yourself is quite useful - but soaking up pre-condensed knowledge via a good book is much faster.
5:37:14
John[Lisbeth]
I dunno I have not read a programming book in the 7 years that I have been learning code.
5:37:39
John[Lisbeth]
And yet here I am in emacs --daemon && emacsclient -t inside of a termianl in a vm in ms azure programming in emacs and lisp and forth and javascript
5:39:00
Bike
You read a book, or a tutorial, or /something/, to get a foundation, and you code to get actual practice, and you ask questions to fill in the blanks that can't reasonably be written down.
5:39:02
whoman
digital words on a screen are not that much different than inked words on paper. give or take some lumens.
5:39:38
John[Lisbeth]
That is if I follow all the languages I learned c++ > bash > haskell > lisp > forth > javascript
5:39:57
John[Lisbeth]
IF I had stopped and mastered each of those languages before moving on to the next one I would still be stuck on some of the earlier languages
5:40:35
whoman
the languages aren't exactly "linear" like that, outside of your experience with them, John[Lisbeth]
5:41:01
John[Lisbeth]
All I know is if I find out the language I am using is crappy I toss it for the next best thing. But Lisp an forth do everything I want
5:41:11
Bike
congratulations, you can use eval. you have defeated the evil bike. Now you can move on to a good language like snobol.
5:42:01
John[Lisbeth]
I am on about you guys are bad at supporting list and thus unreliable for the community
5:43:06
John[Lisbeth]
If you try to help someone by telling them that they don't understand what they want then youa re doing something fundimentally wrong. When I ask you a question I know what question I am trying to ask
5:43:26
sukaeto
I would just like to interject: this is the weirdest conversation I've read/heard in a long time
5:43:45
John[Lisbeth]
Well I dont come on here often cause the channel is so unreliable. I talk like this normally
5:44:20
whoman
ACTION thinking quietly to self: hmm yeah. macros are quite the thing. dont see much public code that uses them really, though.
5:44:42
Bike
If you don't like us so much, then - again - fuck off. You evidently don't need our help! I'm not particularly concerned with my help technique. The only person who doesn't seem to like it is throwing LotR memes at me out of context.
5:45:00
John[Lisbeth]
I do need your help just you are so unreliable in helping me that I dont often seek it out unless it is an emergency