freenode/lisp - IRC Chatlog
Search
6:30:49
ck_
(unless a b) is not a program source, then? I'll make a note of that, so I don't accidentally ever type it as part of a program
6:31:27
ck_
but you're missing the entire point. A asks about macros, B answers (with an answer you don't like, granted), and you address B with a correction
6:31:58
pjb
ck_: No, it's not. It's a template. a stands for any expression, but b stands for any SEQUENCE of expression.
6:32:05
ck_
if you wanted to set the record straight for the person asking, why not tell them directly? That's what I wanted to know
6:37:45
pjb
I thought of G-force, but there are a lot of causes to Tunnel Vision. https://en.wikipedia.org/wiki/G-force
6:41:32
beach
afiddegnum: Again, it is not clear that your use case requires macros, so forget about them until you can't get rid of boilerplate code without them.
6:41:45
afiddegnum
ok, thanks for your contributions, i m still reading through, I believe Macros fit into what i wanted to do but i just want to know how and when to use it right
6:43:06
beach
afiddegnum: It is a common mistake by beginner Common Lisp programmers to attempt to use macros where functions will work.
8:12:55
marcopersson
How come (typep #(1 2) '(vector string)) return t? It seems like typep ignores the element type?
8:18:28
beach
"only those vectors are included whose actual array element type is the result of upgrading element type"
8:20:33
beach
... meaning SBCL does not have a specialized array type for strings, which is not surprising.
8:25:03
marcopersson
I think so.. So the type specifier is this case isn't so much about the contents of the vector, as it is about the representation, and since this is not a specialized vector, the element type in this case doesn't really matter because of that?
8:25:53
beach
Right, the type of an array is not directly related to its contents. It has to do with how it is represented.
8:34:02
marcopersson
Okay, so if I can only get type checking (from SBCL) of array element-types if SBCL support that specialization
8:36:32
beach
Nothing prevents you from wrapping (SETF AREF) in something that will check the type, though.
8:38:13
beach
Wrapping would be a good idea anyway, since your array most likely represents some application data type, so you would want to hide the fact that you are using an array to represent that data type.
8:44:47
marcopersson
Hmm, does it then even make sense to (declare (type)) vectors' and arrays' element types if they're not specialized? I assume then that SBCLcan't take advantage of that extra information for optimization when it's not actually guarranteed from the representation
8:45:12
beach
Like for example, if your vector represents a graph, you would want an abstraction such as ADD-VERTEX, hiding the fact that the graph is represented as a vector. It is then natural to check that a vertex was given.
8:46:36
beach
It doesn't make sense. The standard says that declaring a type is the same as wrapping all references to the variable in THE.
8:47:25
beach
So, if the type is not a specialized array, then it will check that the array has element-type T.
8:51:56
beach
Otherwise, you will end up writing a lot of declarations that you will often change later.
8:53:05
beach
That's one of the problems with statically typed languages. They force you to provide information that often does not remain true for very long.
8:53:31
marcopersson
Yeah, I shouldn't really be focusing on it at all, since this is just a prototype, and I won't be allowed to write the final product in CL anyway. I just ended up playing with types, and just got suprised by the whole (typep #(1 2) '(vector string)) thing and wanted to know more
8:54:10
beach
If you really want to do that kind of stuff, define application types with DEFTYPE and use those types. Then there is only one place to modify later on.
8:56:38
marcopersson
Good advice, thanks. And yeah I won't have any luck convincing C#/C++ programmers at my comp. to start a production CL project, so C# it is..
9:03:41
beach
Trying to convince won't work. Showing what you can do, presumable faster than your colleagues might.
9:05:43
marcopersson
Yeah, the problem then becomes "What about when you leave?", the whole finding developers/maintenance spiel
9:06:08
beach
Do your colleagues know that it is impossible to write a C++ program that is both modular and fast?
9:07:45
beach
If they did, they would notice that training people is less costly than the loss of productivity working with inferior tools.
9:13:13
marcopersson
For this project specifically writing it in C# does give the advantage that it becomes a 1st class citizen in the runtime that is the subject of the program
13:21:37
jcowan
I figure that uninterned symbols ("gensyms" for short) have three distinguishing properties: 1) they are never eq to anything else; 2) they are not read-print invariant; 3) they can be freely garbage collected even when interned symbols cannot be.
15:25:04
jcowan
dlowe: That's what I was thinking. So you can approach property 1 as a limit by using ordinary symbols long statistically-random symbol-names instead of gensyms, at the expense of property 2.
18:26:28
reaper
Looking around for cross platform GUI libraries, I find the most of them are outdated or not maintained
18:28:40
Xach
If your main goal is to learn CL so you can use free, portable, nice GUI tools, you will have to write those tools.