libera/#commonlisp - IRC Chatlog
Search
12:32:54
dbotton
dlowe sorry, yesterday was busy day. So re-reading. "for unimported symbols, you have to specify :: instead of :" that is a violation of interface/protocol or perhaps internal "private" use of a symbol.
12:35:34
dbotton
In the first attempts to demonstrate Ada's new 'class wide types and tagged-records (it's oo system) which like CL is "different" from smalltalk/java/c++ in that neither provides encapsulation, there was an attempt to teach using packages to provide the encapsulation of objects
12:40:19
dbotton
package exports seem outside of generic functions the some total (ok comments also) of CL's ability to write up a protocol/interface
12:42:28
beach
Of course you can determine a protocol in Common Lisp. You just list the (often generic) functions and the types (often classes) they apply to, and the semantics of their use.
12:42:29
dbotton
I think I need to better write up things then first, and I know still will lack clarity but at least can demonstrate practically my intentions
12:43:52
beach
dbotton: I usually turn my code into a collection of "modules" where each module consists of an ASDF system definition, one or more package definitions, and the code that implements the module protocol(s).
12:44:21
beach
dbotton: The names of the functions and classes are symbols that are exported from some package.
12:45:01
beach
dbotton: So when you write down those names, you also mention the package of the symbols in question.
12:47:01
beach
I see. Well, as I often point out, if Common Lisp were to include the preferences of everyone, then the standard would be closer to 10000 pages than to 1000 pages, and people already complain that it is too large.
12:47:39
dnhester26
Hi, a macro question: I have a loop which collects a list of forms, but it returns a list of forms so I get ((form1) (form2)) which gives me an error. How can I make it so that I get (form1)(form2)? Doing `,@(loop) didn't work for me... I could make some random `(let ((x 1)),@(loop)) but that's just a workaround...
12:47:45
beach
Having classes do encapsulation is probably the reason why there are so many growing complaints about traditional object-oriented programming.
12:49:34
beach
dbotton: And if you follow the CLIM II style, then the package that exports the symbols of the protocol contain only those symbols.
12:50:25
beach
There is the CLIM II specification. But it is mostly about the functionality of CLIM II.
12:51:23
yitzi
I think it is open for debate whether the "classes" or the generics are the protocol.
12:51:24
dbotton
People coming to CL have to read CLIM code to best practice how to use CL is bad policty
12:52:09
beach
dbotton: Yes, there are too few people using Common Lisp. Do you have suggestions on how to fix that?
12:52:55
dbotton
beach I am working on it :) I am seeing new people all the time with CLOG and want to pull more
12:53:01
beach
dbotton: Again, yes, there are too few people using Common Lisp. Do you have suggestions on how to fix that? Or are you saying we should dissuade people from using Common Lisp?
12:56:45
dbotton
will read through - and is there a step by step how to set up a software project so that it revolves around the protocols?
12:57:40
beach
dbotton: Like I said, I usually turn my code into a collection of "modules" where each module consists of an ASDF system definition, one or more package definitions, and the code that implements the module protocol(s). Each module lives in an OS directory.
12:58:25
dbotton
can you send me a link to the most representative of that, so perhaps I can use that as part of a tutorial
12:58:46
beach
dbotton: So the step by step is: 1. Create the directory. 2. Create the ASDF system definition. 3. Create the package(s) file(s). 4. Write the code.
13:03:04
beach
"CLIM is the package where the symbols specified in this specification live. It contains only exported symbols and is locked in those implementations that allow package locking."
13:04:43
dbotton
(sorry for being frustrating, but I see this undocumented area of CL being a frequent wall to people new to CL)
13:06:08
beach
dbotton: The frustration is because all the things I have showed you are discussed here frequently, so I am a bit surprised you haven't heard of them.
13:07:33
dbotton
The issue is that the parts are not a practical guide and the theory is what is discussed
13:08:29
dbotton
A non-cs programmer is not going to glean from what is said or pointed out (even today) a practical system to use
13:09:06
dbotton
I am being frustrating today so that I can make sure I have enough to write it myself :)
13:10:12
dbotton
At this point I can get just about anyone with basic skills quickly capable of using and reading CL code
13:10:54
dbotton
what I need to do is get them to a point they can design a system and then program it in CL
13:11:39
dbotton
one that does not turn out like the majority of what I see, tons of random bits thrown in a package or two
13:14:37
dbotton
CLOG has now a solid IDE and a solid GUI builder, so so templates, I need a solid set of guide lines and tools to keep a project organized and reusable
14:00:04
dnhester26
a question about restarts and conditions: My use case is like this: I would like to check some input data, if it has a problem signal a condition. Now on the handler, when receiving that condition, I would like to check the input data programmatically and see if I can change it in a way that solves the problem, and try again. If the data can't be changed, then do whatever the handler-case would do. is this possible? When getting to a
14:00:04
dnhester26
handler-case, change the data, and try running the same form again with the new data instead? Is that a restart? In the spec it refers to interactive which I understood to mean that a user is interacting with the REPL, though I may have mistunderstood
14:02:49
bike
"interactive" in this context does mean user interaction, but you can use restarts programmatically as well
14:05:09
dnhester26
bike: thanks. So handler-bind. I'm not sure if it's better to just make a more complicated function which deals with the data instead of using handler-bind which may be overly complicated because of the macro. What do you think? Is it better to keep it "simpler" and just use a longer form or to use a handler-bind which may be more advanced but probably a cleaner solution?
14:05:58
dnhester26
yitzi: restar-bind had no examples, I was just reading with-simple-restart, ahven't gotten to restart-case
14:13:58
dnhester26
yitzi: restart-case is just providing options for the user to choose in the REPL on how to deal with an error, not sure if that really helps me, but thanks, it's good to learn something new! :D
14:18:00
dnhester26
I don't get in the example: http://www.ai.mit.edu/projects/iiip/doc/CommonLISP/HyperSpec/Body/mac_restart-case.html
14:18:12
dnhester26
Why is the restart case starting from calling this (all-start-with-same-letter ice-cream sauce topping)?
14:20:26
dlowe
dnhester26: ERROR is called which invokes the debugger, which gives a menu of available restarts
14:21:56
dlowe
basically, the example loops until all-start-with-same-letter returns true, and it uses the debugger to fix the various ice cream problems
14:21:59
dnhester26
dlowe: oh! thank you! now I just got the example. So why did they add that function call? It seems completely unrelated to the example
14:24:02
dlowe
probably the most common restart-case I've used is when decoding utf-8 from a socket, and the decoder will throw an error on invalid utf-8 but with restarts that allow the program to decide how to handle it
14:34:08
dnhester26
dlowe: pardon my ignorance for I have never used do. what is the last statement doing there? when is it called? it's after the test form, form the spec I don't understand
14:35:54
dnhester26
is it evaluating only if the test-form fails? That's what it looks like to me, but from the spec I couldn't understand
14:38:09
thuna`
dnhester26: That DO evaluates its body - which is the RESTART-CASE - until the result of (ALL-START-WITH-SAME-LETTER ICE-CREAM SAUCE TOPPING) is non-nil.
14:38:22
dnhester26
In this line in the spec "At the beginning of each iteration, after processing the variables, the end-test-form is evaluated. If the result is false, execution proceeds with the body of the do (or do*) form. If the result is true, the result-forms are evaluated in order as an implicit progn, and then do or do* returns." I don't see in the sytnax neither the body of the do nor the result forms
16:37:14
hayley
jmercouris: Consider writing --quiet with two hyphens before you smartass about wHaTeVeR rEaSoN.