freenode/#lisp - IRC Chatlog
Search
18:03:52
Xach
I guess I need to make it really easty to run outside of quicklisp dist construction like, right away.
18:15:14
akem
what slime contribs do ppl usually include? I have the slime-fancy one by default, but I noticed that this doens't include slime-cl-indent
18:25:01
Xach
Ah yes, there are problems with bare $0 and the path, now I remember. But it should work for the documented case anyway.
19:18:12
cgay
ob lisp: I was surprised today to rediscover that z must be positive (loop from x downto y by z ...) since it seems natural to say "by -1" there.
19:19:45
cgay
Sure. I can see that once you have decided to have "downto" in the language you could arrive at that decision legitimately. :)
19:19:50
z3t0
I can get the basic-window example to run as per the instructions, but cannot get it to run if I try copy pasting the example code into my own
19:30:18
lambdice
do you know if the result of type-of is consistent over all the implementation of common lisp ?
19:32:01
lambdice
Shinmera: in fact i am having fun with a little tool for serializing different object, vector, hash-table etc
19:35:30
pjb
lambdice: there are constraints on the types and their subtype relationships, but some subtypes may be equal to their supertype, or the implementation may have additionnal types in the middle. Testing (subtypep (type-of x) some-type) or (typep x some-type) will give more consistent results.
19:39:22
pjb
Yes, but float has 4 subtypes: short-float single-float double-float and long-float. Some implementations have the four subtypes distinct. In some other implementations, short-float = single-float and double-float=long-float. There are constraints on what subtype may be equal to what other.
19:40:09
pjb
Another example, the type character has two distinct subtypes base-char and extended-char. But in some implementation base-char = character, and extended-char = nil.
19:40:37
Shinmera
I think it's even allowed for type-of to return something other than symbols and conses as long as you can do typep and subtypep with the returned type.
19:42:08
pjb
Also, when you consider type-of, implementations may be moreor less specific. eg. (type-of 1) returns BIT or (INTEGER 1 1)…
19:44:24
Shinmera
lambdice: My point is also that the type returned might not even be readably printable.
19:45:21
pjb
clhs 4.2.3 says Type specifiers can be symbols, classes, or lists. so I guess Shinmera is right, #<class foo> could be the result of (type-of (make-instance 'foo)) Perhaps it may occur when the class is anonymous.
19:45:51
lambdice
Shinmera: indeed, pjb point on testing the type with subtypep on something more general
19:45:53
pjb
clhs 4.2.3 says also: A class object can be used as a type specifier. When used this way, it denotes the set of all members of that class.
19:49:13
pjb
But you need to add the variants, such when base-char = character, or short-float=single-float, etc.
20:15:10
rumbler31
so i've wondered, while the graph of types is nice, what do people really use it for?
20:25:07
pjb
rumbler31: to know that you can call the function (defun f (x y) (+ x y)) with as arguments any pair of numbers, including fixnums. Or complexes.
20:44:20
jasom
Xach: I seem to recall someone saying that it wasn't quite a lattice due to certain array type rules?
22:10:04
vsync
this may already be documented but why does ASDF have (ASDF:LOAD-OP op ...) rather than (op ...)?
22:16:20
Shinmera
oos stands for "operate on system" and will construct the operation object for you, then compute a plan for said operation on the given component, and finally execute it.
22:16:59
Shinmera
Because PERFORM is a method that uses multiple-dispatch so you can specify on component, operation, or both.
22:17:25
Shinmera
So making a method for each operation instead, aside from not allowing you to associate data with the operation, would be less flexible.
22:18:15
Shinmera
Invoking the MOP and other such things is not exactly a great idea for something that should work on every implementation seamlessly.
22:18:55
vsync
or, "you have a problem and decided to use metaprogramming... now you have a problem-factory-factory" take your pick :)
22:20:31
vsync
and yes, I think I've just bought in to redoing my design to eschew gratuitous metaclasses
22:21:16
vsync
though I still feel like slots on the metaobject class are conceptually cleaner than :allocation class on the instance class
22:21:47
vsync
but the key seems to be taking a step back and figuring out my protocol before the modeling... it feels like the answers will naturally come forth
22:23:12
vsync
I always go for interface-first... protocol classes with more detailed subclasses seems to be the same at a very slightly higher level of abstraction
22:23:52
Shinmera
The interface is about how you use something, and the protocol is more about how things interact. There's an overlap, but not necessarily so.
0:18:18
z3t0
but for some reason I cannot do this when inside a function, as the item just doesn't get added... even though the return value of (push) is correct
0:18:32
Bike
(push item list) macroexpands to (setf list (cons item list)), i.e. it just alters a variable binding. the variable is bound by the function, so the push doesn't affect the caller's environment.
0:19:22
Bike
it's like, if you had (defun foo (x) (setf x (+ 5 x))) (let ((n 3)) (foo n) n) you'd get 3, not 8.
2:01:27
vsync
jasom: ah good to know... my question was more about the underlying architecture though
4:36:21
beach
I am willing to bet that there are more European Lispers here than North American Lispers.
4:38:42
lambdice
i think i read that lisp was promoted by ppl from MIT, while ppl on the EU choose prolog
4:41:24
flavio81
if i have read correctly, on a paper by Richard P. Gabriel on the history of Lisp, part of the reason the USA pushed for standarizing Common Lisp was that they were afraid the EU could do it before them
4:42:44
beach
Things have changed. The US industry and academia abandoned Common Lisp. Nobody in Europe ever used EuLisp it seems. Now, Common Lisp seems to be used more outside the US than inside.
4:43:34
beach
Now, Poland seems to be the center of activity in the Common Lisp world. I think that is great.
4:44:20
flavio81
Poland? amazing, i had a visit from two high level polish guys from my company, they command a team of data analysts (among other people) and they thought Lisp was a 1950s language (implying no further evolution)
4:44:53
flavio81
well, better for me, perhaps one day they'll get me a job there, once I finally grok CL
4:45:25
beach
shka_: Look at it this way. Currently Poland has the advantage of a high level of skill in its programmers, yet salaries are low. Soon, salaries will rise to the level of the rest of the EU. Then what will you do? One way to stay ahead would be to use better programming tools, so that you can be more productive than others.
4:47:12
flavio81
i just surveyed superficially the language (clojure) and most of its core and constructs. I guess that if they make me choose between java and clojure, i'll gladly take clojure; however if i had to choose between CL and clojure i'd take CL. Nevertheless, i think getting paid for writing in any lisp would be great.
4:48:50
flavio81
i simply don't like how clojure is deeply interwined with java. Even the nomenclature. For example in Lisp, you know what it's an "atom". But in clojure, an "atom" has a different meaning, lifted from java.util.concurrent.atomic.AtomicReference, which is what an atom instances, in Clojure.
4:49:16
shka_
beach: well, i don't think that i have, that's true. Everything i do comes from my inner needs, not hope to actually change anything.
4:49:39
flavio81
so clojure is tarnished with Java down to the nomenclature; there are even things that should be in a Clojure "Standard Library", to put it in some way, but they aren't: you need to invoke a java method.
4:51:37
flavio81
lambdice: i have programmed in java in the past, professionally for about 3 years; for me, java is repression and Lisp is the opposite extreme; to program in Lisp but still have to submit to calling java functions for TRIVIAL things, is a bit like having to deal with the mafia. It feels dirty. I think it's great that one can call java from Clojure
4:51:37
flavio81
easily. However, i don't like when this is used to do things that should be built into the language stdlib in the first place.
4:53:25
lambdice
borei: humm not sure if it could help if it is a little snipet you can try to run directly with from C and see if the can find the same bug
4:55:47
flavio81
lambdice: i can bet i'm not the first to say something similar. I've not met any experienced developer that liked Java.
4:57:23
lambdice
flavio81: i have found for me that learning the theory of lisp, core of the language, is so easy, but the practice is so hard like packaging, tools, library
4:57:29
flavio81
lambdice: i mean, i respect the JVM and it's speed, and the huge amount of libs. But compared to Lisps (plural), it's a low level language where macros are implemented by humans sitting at the desk like monkeys and spitting out tons of boilerplate code (usually to apply some "design patterns" to supply things that the language doesn't allow)
4:58:23
lambdice
flavio81: well yeah defpackage, asdf and also creating application bundle for end user for example
4:58:37
flavio81
lambdice: in my workplace we had several Java Macro Processors, they were named Javier, Giancarlo, Flavio, etc... and paid monthly
5:00:14
flavio81
lambdice: which are named "namespaces" in C# and Clojure. Namespaces make your symbol names don't collide as long they are... in separate namespaces !
5:00:51
aeth
I think a lot of the problems with Java aren't Java the language but Java the idioms and culture.
5:01:20
flavio81
lambdice: ASDF allows you to define "systems", a system is a collection of files where you specify which file depends on which, etc. So the system can be compiled as a whole. Of course, those files will probably do stuff inside their own namespaces (one per file) so symbols don't collide. It's up to the programmer.
5:01:24
aeth
There's not much stopping you from writing decent code in Java, it's just not the culture of Java
5:02:17
flavio81
lambdice: then you have quicklisp which is a tool that allows you to easily fetch "Systems" from The Internets, compile them, and have them ready to eat at your machine
5:03:44
flavio81
aeth: me and my friends wrote decent java code for years, and when you look at it from a Lisp perspective, that decent code was too long, too repetitive, and could have been implemented in far less time with a more powerful language. In other words, yes, nothing stops you from writing decent code in java. Also, nothing stops you from writing decent
5:03:51
borei
honestly saying, i found that quicklisp is a bit dangerous tool for beginer lisper - too many thinks are happening under the hood
5:04:34
aeth
flavio81: give me assembler with s-expressions and a powerful enough macro system and I'd prefer it to half of the programming languages, probably.
5:04:56
flavio81
lambdice: it's simple, just learn how to defpackage first, then how to define your system (and then compile it using the suitable asdf function)
5:06:00
flavio81
aeth: Yes, agree. And assembler has that rare quality (think Lisp) where the code is data -- at the end, machine language is computer words. You can do self-modifying code, etc.
5:06:22
lambdice
flavio81: i defpackage, i made nice system, i downloaded sdl2 from quicklisp, i have the best game of the world!! how can i share it with my friend ?
5:07:10
flavio81
lambdice: you upload your project into Github (or in a ZIP file or in a .tar file, etc); and make sure to include the system definition file (.asdf)
5:08:17
flavio81
lambdice: no no, in the ASDF, using :depends, you specify the libs that your "system" depends on
5:08:53
flavio81
then your friend can download the zip file you're giving him/her; and then he/she uses quicklisp to give quicklisp the task of locating those dependencies, downloading them, and then compiling your system
5:09:47
flavio81
lambdice: well... if you want to make things happy for him/her, yes. He/she still can just download the dependencies by hand and forget about quicklisp !!
5:11:11
borei
it (quicklisp) installed all dependecies, so i completely lost what i have and what versions
5:12:08
borei
once you are experienced lisp programmer familiar with eco-system - then quicklisp is very powerfull tool
5:13:24
borei
inetersting with opengl - my first test was for mesh 100x100, it took .64 secodns to load all vertices approx 30k floats
5:17:28
basket
It's a pretty minor complaint but the terminology in Clojure is the worst UX part of it for me. There's atoms, but they're not what Lisp calls atoms, there's an operator/type called cons, but it's not what Lisp calls cons, there's an operator called do but it's not a looping construct, and so on. It just makes for so much friction trying to use it
5:19:15
flavio81
basket: exactly; even more, exactly what i posted some minutes ago. I really got a bit angry with Clojure use of the "atom" word
5:19:40
flavio81
basket: also "ref" ... a bit silly, a bit silly terminology overall, to do things like transactions using STM
5:20:12
basket
I'm pretty sure about the second thing I ever typed into a Clojure REPL was (cons 1 2), what a terrible first impression
5:20:45
flavio81
basket: i felt like... how about calling things like "perform-transaction" or "do-atomically" ?
5:21:40
lambdice
what is your stategy when you are coding you own project, you put a symlink of your asd file into the default directory asdf:*central-registry* or you add your project directory in asdf:*central-registry* and let your asd in your project directory
5:23:30
aeth
Common Lisp, Scheme, and Emacs Lisp are the only Lisps that feel like they actually do things the Lisp way.
5:23:51
aeth
So many newer Lisps go out of their way to either be different or to miss the point completely.
5:24:07
flavio81
lambdice: i'm a lazy guy, i put my projects on what the default central registry dir was... and stopped worrying. But you can define where do you want your central registry.
5:27:09
flavio81
lambdice: i don't think a symlink of the .asd file would work. I think you'll have to symlink the whole directory containing the asd file (and the rest of your files)
5:29:48
pjb
flavio81: once upon a time symlinks to the .asd worked, I see no reason why it should not still work.
5:35:10
ahungry
if you have a custom project directory, adding something like (pushnew #P"/your/path/here" ql:*local-project-directories*) is useful to include in ~/.sbclrc (assuming you're an SBCL user)
5:38:44
pjb
flavio81: that said, since quicklisp is able to scan directories automatically, it's better nowadays to symlink directories in ~/quicklisp/local-projects/
5:39:32
pjb
symlinking asd files was good when we used asdf directly, simplier than pushing lots of directories on asdf:*central-registry*…
5:41:04
flavio81
lambdice: you can use asdf to compile systems... you can also use quicklisp to load and compile systems; because quicklisp uses asdf too
5:41:11
whoman
fwiw, something that tricked me up a little, was putting defpackage in package.lisp, which the .asd components includes. it may sound abstract but it solved my initial anxiety with asdf