freenode/#lisp - IRC Chatlog
Search
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
5:51:45
aeth
whoman: Here's a fancy macro in the wild, probably the fanciest I've personally used: https://gitlab.com/zombie-raptor/zombie-raptor/blob/000f644b2aa673249fc2da64ce115d7a68a073b1/examples/shaders.lisp
5:52:09
aeth
It's just GLSL in s-expression form because I kept making stupid syntax errors switching back and forth between CL and GLSL
5:53:07
whoman
one of the first reasons i wanted/needed macros is to avoid repetition, and i always dont feel that the world is right when i see heavy repetition in lisp code. going to check out that code now
5:53:10
beach
Oh, so that's the impression that some people have, i.e., that #lisp is a "Lisp support channel".
5:53:41
aeth
The actual macro is defined here: https://gitlab.com/zombie-raptor/zombie-raptor/blob/000f644b2aa673249fc2da64ce115d7a68a073b1/data/shader.lisp
5:53:51
beach
So, these people think they are entitled to get help for free, even though they make no effort whatsoever to follow the advice they get.
5:55:44
beach
17.05.11:06:52:45 <John[Lisbeth]> so (defun (intern "mystring") () (+ 2 2)) shoudl give me no problems
5:56:03
beach
17.05.11:06:56:11 <John[Lisbeth]> so I can (defun (eval (intern "foo)) () (+ 2 2)) then?
5:56:07
aeth
whoman: It's also probably some of the Lispier code I've written because it's macro-expansion-time so I don't worry about performance that much there. It's iirc basically in the style of The Little Schemer. Iirc.
5:56:51
whoman
it is best not to take things personally in this case especially. buddy is just talking "to internet people" and nothing to do with healthy relationships
5:58:01
whoman
aeth, cool =) i see optimization stuff too, like declaim. (i dont know much about these yet) but i can feel it is good code.
5:58:44
Bike
well, declaim inline is pretty straightforward. just indicates names of functions that should have inline definitions saved and used.
5:58:48
aeth
whoman: oh, if you see declaim/declare in the shader stuff and think it's strange, don't look at the stuff that has to run during the game loop
6:00:15
aeth
(defun foo (x y z) (declare (single-float x y z)) (+ x y z)) ; in most modern implementations, this will type check at safety != 0 and assume types at safety = 0, and use single-float-specific +, not the generic + that operates on the whole numeric tower
6:34:02
aeth
Terrible timing, the power went out just as I was in the middle of typing two code examples, and the second (that didn't get sent) is the one that was more relevant (on declaim, rather than declare)
6:40:40
aeth
declaim goes outside of the defun rather than in the first part, and unlike declare (which has some other common uses like optimization levels) is, at least in my limited experience, almost always just used for inline
9:01:36
beach
ACTION is finally making progress on the implementation-independent lambda-list parser meant to be part of the "Concrete Syntax Tree" library.
12:24:51
splittist
beach: (or anybody) what body of well written, adequately documented code should I be browsing to kick me into thinking protocols rather than objects. (Answers with Swift in them will be ignored.)
12:30:53
jackdaniel
MOP is one, CLIM has dozen of protocols (as specification), beach libraries usually are documented around protocols (i.e Cleavir)
12:31:23
phoe
splittist: also, beach has publicized a chapter of his book that defines what a protocol is. It's good read - you should poke him for it.
12:41:07
_death
for thinking protocols you shouldn't read code, but specs.. the clim one is the primary example I know of
13:11:36
beach
splittist: The documentation is fairly complete as well, and specifically talks about protocols.
13:12:48
beach
splittist: It is fine to mention classes (in particular protocol classes) in a protocol. And it is fine to mention :INITARGs. But it is not fine to mention slots.
13:14:57
splittist
beach: yes. I was just thinking that multiple inheritance avoids many of the problems other languages are re-inventing protocol orientation to ameliorate.
13:17:45
dim
multiple dispatch but also dispatch on all types (hash-table, list, array) not just “objects”, and including dispatch on specific values (eq dispatch)...
13:22:58
dim
what I mean is that standard types are objects as far as dispatch is concerned, you can actually dispatch on list
13:24:24
jackdaniel
yes, but for instance double-float is a type, but spec doesn't mandate being it built-in class
13:24:38
jackdaniel
so you can specialize on float, but specializing on double-float is implementation dependent
13:25:03
jackdaniel
this is very useful diagram: http://sellout.github.io/2012/03/03/common-lisp-type-hierarchy/
13:25:43
dim
in Java you can't do anything with an int, you need to use an Integer, but you can't say Integer + Integer, it's Integer.add()
13:26:56
Xach
dim: long before i knew anything about lisp, jwz's rant about BigInteger math struck me.
13:28:06
dim
I don't know about that article Xach, but I know I refused to admit that Java like OOP was anything useful to write good code and then “saw light” when finally read about CLOS
13:29:02
Xach
(jwz's rants also helped me grok that you can refer to and work with "objects" without having direct language support)
13:30:54
Xach
something i also saw reinforced when alvy ray smith explained his object-oriented implementation of sprite image editing in C...
14:21:02
doby162
Is there a standard way to deploy executable binaries to an OS that I don't have access to? Or is the best way to just get access to that OS?
14:21:42
jackdaniel
what do you mean, that you don't have access to it? putting executables to system you have no access to would be breaking its security :-)
14:21:50
Xach
doby162: That sounds like an interesting challenge, but it does not seem especially lispy.
14:28:48
phoe
note that CCL does not work under wine AFAIK, though CCL is one of the two suggested implementations for Windows (the other being SBCL).
14:29:46
doby162
I use sbcl by default so I'll probably start with that. I saw some old google groups discussions about cross compilation but they all linked back to http://sbcl-internals.cliki.net/ which seems to be dead
14:34:07
|3b|
they were probably talking about building the base sbcl executables rather normal user programs, and even for that you still need to run the final part on the target platform
14:34:47
|3b|
(and some of the intermediate parts as well i think, so it can detect features of the target environment)