freenode/#lisp - IRC Chatlog
Search
22:34:18
edgar-rft
noobly: #emacs was locked for users with non-registered nicks a while ago because too much spam.
23:11:04
MoziM
is there an elisp function that can change all the values of a property in a nested plist? this is an example of what i'm trying to navigate through, i want to set all :background properties to "black" http://termbin.com/9j5o
23:44:59
karlosz
it seems that converting to hir takes 2 out of the 10 seconds it takes to compile alexandria
5:11:05
beach
asarch: I would like to know the specific feature you are looking for that you can't already do in CLOS.
5:21:50
beach
asarch: (defgeneric show (water)) (defmethod show ((water chocolate)) (format ...)) (defmethod show ((water coffee)) (format ...))
5:22:36
beach
asarch: And can you tell me what a "virtual function" allows that a generic function does not allow?
5:28:37
asarch
As you already know, virtual functions actually helps C++ to do the polymorphism stuff
5:29:46
beach
asarch: So the simple answer to your question is "no". But that doesn't mean that you can't do the things you can do in C++. It might mean that you don't need a special mechanism in CLOS whereas you do in C++.
5:30:10
beach
asarch: Which is why I wanted to know what particular characteristic of virtual functions you were looking for.
5:31:50
beach
For the record, I really dislike questions asked that way, i.e. "Does Common Lisp have the equivalent of the <mumble> feature in the <foo> language"? It presumes that 1) everyone knows the <foo> language. 2) that if <mumble> does not exist in Common Lisp, then Common Lisp is somehow inferior.
5:32:48
beach
I much prefer "What mechanism in Common Lisp would you use to solve the following problem...".
5:35:14
asarch
I guess that is the easiest way to ask things: "Can you do overload functions in Lisp?"
5:36:17
beach
"overloading" is typically a compile-time mechanism, whereas "generic dispatch" is a run time mechanism, so much more powerful.
5:38:27
loke
asarch: “overload” menas that you can have several functions with the same name. It does not imply that the choice of which implementation to call is actually chosen at runtime.
5:39:08
loke
asarch: In C++, if you have two functions: void foo(int) and void foo(char), that's overloading.
5:39:31
loke
asarch: But for the compiler to be able to choose which function to call, you have to know the type at runtime.
5:39:33
beach
asarch: Consider a method FOO in some language like Java or C++. It has two signatures, each with one argument. One signature has a DRINK argument and another has a COFFEE argument (COFFEE is a subclass of DRINK). Now do a DRINK d = new(COFFEE) and then x.FOO(d).
5:39:49
asarch
I thought: (defgeneric show (caffee) ()) and (defgeneric show (chocolate) ()) was actually the same :-(
5:41:06
loke
asarch: Here's another terminology tip for you: In C++ a “method” is a function that is attached to a class. In CLOS, a “method” is some actual code that _may_ be run when a generic function is called. The method is attached to the generif cfunction,. not to a class.
5:42:01
beach
asarch: So which method would be called in my example? The one with a DRINK argument, or the one with a COFFEE argument?
5:43:18
loke
Beach's statement sounded weird, until I replaced the word Drink with Beverage in my mind. :-) (drink being both a noun and a verb made me confused. I'm stupid :-) )
5:45:02
asarch
I was actually reading the pages of the CLOS book from the "Object-Oriented Programming in Common Lisp" book from Sonja E. Keene
5:45:51
beach
loke: The Swedish language is a mess (like most others), but in this case it would have allowed us to distinguish between the verb and the noun, yes.
5:56:23
beach
asarch: Most object-oriented language do a run-time dispatch only on X and not on the argument of the method. Which method will be called in such a situation is resolved at compile time, so the answer is "wrong" in this case. CLOS has multiple dispatch, so it does not have that problem.
5:58:50
beach
It is interesting to me that there are lots and lots of programmers out there, using one of these languages professionally, to produce code that runs in applications that I might have to use, and who do not know this fact.
6:06:39
asarch
I even bought the "The Art of the Meta Object Protocol" book when I was learning to use the web development framework from Perl: Catalyst
6:07:38
asarch
When I was working as an English teacher, all I wanted was a web application to keep all the related stuff for my students
6:11:03
beach
What is taught by a typical 5-year masters program (according to the Bologna system) is simply not enough to program professionally. But industry does not know that. So either we need to train industry to continue educating the programmers after they start working, or we need to define some kind of doctoral-level teaching program that should then be a requirement for working in industry.
6:11:49
beach
Stuff like this (overloading, single/multiple dispatch, etc) should be part of such a training program.
6:12:59
aeth
people have strong opinions about paradigms, and those strong opinions change with fashion, and the fashions change too quickly for programs to keep up
6:13:15
mange
beach: Maybe I misunderstand you. Are you saying that people should get a PhD before programming in industry?
6:14:23
aeth
mange: I think what beach is saying is that masters degree programs teach the wrong thing
6:15:21
beach
mange: It would not be a PhD, but some other doctoral-level program. A PhD is a research-oriented program, so that might not be well adapted to this situation.
6:16:11
beach
Yeah, but my estimate is that it would take at least 2 years after a masters degree, so a doctoral-level program would be possible.
6:17:35
beach
And, of course, as a Lisper, I consider it totally unacceptable for anyone who will program professionally not to have knowledge about Common Lisp, CLOS, MOP, etc. If for no other reason, to avoid re-inventing the wheel and being able to compare to what they are forced to use.
6:17:36
MichaelRaskin
I think the industry has recently discovered that what they want is trainable in one year (_instead_ of 5-year program). They don't care much for anything to work when they cannot define «working» code even postfactum
6:19:24
beach
The big mistake in academia is to think that industry NEEDS what it WANTS, which results in our teaching programs being a disaster.
6:19:52
MichaelRaskin
I think no amount of training programmers will help industry that doesn't care about correctness in specs _and_ defaults to not letting programmers talk to users directly and regularly
6:20:17
mange
Yeah, I think the bigger problems are in the the industry's priorities, rather than training.
6:22:44
beach
asarch: x WOULD be used for dispatch (that's what single dispatch means). But the point of the example is that the run-time value of d is NOT used for dispatch.
6:25:30
aeth
I don't think formal education is what you would want for programming training. perhaps my experience is skewed, but that tends to be research-oriented.
6:41:46
xificurC
I have a masters from something called maths & management, does that disqualify me from being a good programmer? :(
6:41:47
beach
What current post-graduate programs teach is beside the point. All I am saying is that people who program professionally often need way more knowledge than they get from a typical masters program. And since people working in industry are largely ignorant about such knowledge (which is why the don't WANT what they NEED), academia would have to be the place to define such a doctoral-level teaching program. Not that it would be easy,
6:41:47
beach
given that most university professors are ignorant too when it comes to that kind of knowledge.
6:42:35
beach
xificurC: There are excellent programmers out there with absolutely no formal training.
6:43:48
beach
But, and this is the point, most programmers receive their only training in some university program (at most 5 years, more often shorter). For them to be excellent, they need more training.
6:44:24
beach
They are not going to do enough self study to become good, and the company they are working for is not going to train them either.
6:46:37
shrdlu68
Perhaps an economic model can explain this? The programmers in company X only need to be as good as they ought to be to have some advatage over company Y.
6:47:12
xificurC
beach: my note was only written to let you further drive your point. Not that it wasn't true
6:48:02
White_Flame
beach: wait, you would consider understanding C++-family OO dispatch to be doctoral level?
6:48:28
xificurC
imho studying n years has no point when one doesn't enjoy the field and does self training
6:49:17
beach
White_Flame: I asked the same question to several masters-level students about to graduate, and they had no clue.
6:49:54
loke
beach: When I interview candidates for jobs that require programming experience, I make a point of trying to figure out how they learned it, and what drives them.
6:50:04
beach
White_Flame: There is just not enough about programming-language implementation taught in these programs.
6:50:19
loke
If the only practical programming projects they worked on was school projects, it's usually a red flag.
6:51:42
White_Flame
it's not the end of the world to expect them to learn on the job, if they seem like good learners otherwise
6:51:45
loke
White_Flame: Right, but if you're interestd in the topic, there is no reason why you wouldn't be working on personal projects.
6:54:13
asarch
I remember my next question: reflection and type introspection. Does Common Lisp support those features?
6:55:08
White_Flame
the only weakness with introspection is structures; everything else is fine with reflection & introspection
6:55:54
White_Flame
but there are usually non-standard ways included to fully introspect structs if you want to; normal class-based objects are fully introspectable
6:56:29
White_Flame
however, you generally don't need to introspect much because macros can create whatever metadata you need directly
6:57:04
pillton
asarch: There is also a difference between a type and a class. Types denote sets in common lisp and classes denote representation.
8:37:41
xificurC
uiop:run-program says :interactive makes the subprocess inherit the current output and that it can be different from *standard-output*. Why and how?
8:39:16
jackdaniel
as of why and how (regarding uiop interfaces), sometimes answer is: because it could; in a very hacky way involving internal implementation interfaces. just a general observation of a regular user who tries to make sense of some of these
8:40:57
xificurC
jackdaniel: it says e.g. in SLIME it would behave differently if it just used *standard-output*. Are you saying SLIME is using one of those hacky ways?
8:43:35
jackdaniel
I don't know what is this "current output" in your description, but if it is the lisp implementation process stdio, then SLIME has nothing to do with it (slime binds *standard-output* to a gray stream; uiop may want something with a descriptor, that is stdout)
8:44:40
jackdaniel
for instance ECL allows accessing these things with exported symbols in EXT package (like ext:+process-standard-output+)
8:45:41
xificurC
jackdaniel: I'm just reading the docstring: https://gitlab.common-lisp.net/asdf/asdf/blob/master/uiop/run-program.lisp#L507
8:46:44
jackdaniel
yes, I saw these monster docstring once or twice. that probably means, that it does what I have mentioned - tries to access process stdio
8:48:12
xificurC
jackdaniel: I started using it thinking it's one of those libraries that helps to write portable code
8:49:42
jackdaniel
I won't start rant on it, because there is a lot of work and testing put to it, I just happen disagree with a lot of things in this library (and some of decisions which stand behind these things)
8:51:30
jackdaniel
imho docstrings should provide short contextual reminder (for a person who has read the documentation having lengthier discussion of the interfaces)
8:56:21
shrdlu68
Could you link to the docs for the ~@ directive? I only know of @ as a modifier to other directives...
9:05:01
specbot
Tilde Newline: Ignored Newline: http://www.lispworks.com/reference/HyperSpec/Body/22_cic.htm
9:05:39
beach
"Tilde immediately followed by a newline ignores the newline and any following non-newline whitespace[1] characters. With a :, the newline is ignored, but any following whitespace[1] is left in place. With an @, the newline is left in place, but any following whitespace[1] is ignored."
9:07:52
beach
Yeah, using it means you don't have to ruin the overall layout of your code. Plus, Emacs is not always happy when there is text in column 0 that is not the beginning of a top-level form.
9:55:25
jackdaniel
I remember debugging this kind of issue in usocket (someone put there indifferent closing of the descriptor what caused problems, you may check closed issues for details)
9:56:47
jackdaniel
(also, if the descriptor is valid again - because someone in the meantime opened something else - you kill randomly in your process)
10:21:32
theemacsshibe[m]
Sometimes drakma doesn't pick up on text files (such as those put out by matrix servers). Is there a way to force it to put out a utf8 string? :external-format-in didn't work.