freenode/#lisp - IRC Chatlog
Search
2:48:08
johnnymacs
So lets say I have a package called foo and in foo I have a funtion called car and cdr. And I have another package which uses common-lisp and uses bar. I want to use the bar package with car and cdr but my foo package only uses cl.
2:48:40
johnnymacs
So I want to pass data between packages and layer a hierarchy of namespace priority
3:06:07
smokeink
(cl::car (cl::list 1 2)) ==>1 , and since 'car and 'list are external to the package CL you can use : instead of ::
3:26:05
johnnymacs
The reason I wanted to use packages is to get away with short function names but then you end up having a long package name
3:36:00
johnnymacs
When writing object oriented code one needs to get sub objects very often which is why getting a subobject is just . in most object oriented languages
3:39:33
johnnymacs
(defun dot (table &rest args) (while (not (equal 0 (length args))) (setvar table (gethash (pop args) table))))
3:43:06
pierpa
loginoob: good for what? If it is for learning, there are several good and free books available
3:44:08
loginoob
pierpa: I'm learning from book CL: gentle introduction to symbolic computation. Was wondering to read blogs in free time
3:46:09
loginoob
also in my emacs when i type 'this 'this 'true it return last input i.e TRUE . Shouldn't it return all three
3:49:04
pierpa
as far as I remember, yes, it should print all three results. At the moment I cannot check.
4:25:25
beach
johnnymacs: If you often want to the slots ("subobject"s) of an object, then your code is badly structured. Slots are an implementation detail that should be used (if at all) only by the module that defines the class. Instead, such details should be hidden behind a consistent "protocol" (an extension of the concept of an "interface" in other languages) consisting of classes and (often generic) functions.
5:25:02
smokeink
I want to replace the 2nd code here https://rosettacode.org/wiki/Sieve_of_Eratosthenes#Common_Lisp , with a documented version http://pastecode.ru/19973/ . Please criticize the code on the 2nd link, point out all the stylistic issues and help me to fix it.
6:36:14
johnnymacs
What is wrong with this? (defun gethashes (x &rest y) (loop while y do (setf x (gethash (pop y) x))))
6:59:05
beach
johnnymacs: Perhaps you are confused about how Common Lisp passes arguments. Did you expect the first argument in the call to your function to be modified as a result of the call?
6:59:07
johnnymacs
well I want to take a set of nested hash tables and search through them with keys
7:01:19
beach
johnnymacs: What did you expect to happen to the values that you give to X in this function?
7:05:03
beach
johnnymacs: Did you see my remark you your desire for a compact syntax for accessing slots (what you call "subobject"s)?
8:05:52
johnnymacs
Why is it whenever I try to define a variable it always tells me the variable is undefined
8:07:35
jackdaniel
you define variables with DEFVAR, like that: (defvar *foo* (lambda () (make-hash-table)))
8:23:55
pierpa_
Why write (lambda () (make-hash-table)) instead of simply #'make-hash-table ? Ok, there's a small difference, but does it matters in this case?
8:26:31
johnnymacs
(defun gethashes (x &rest y) (loop while y do (setf x (gethash (pop y) x)) (return x)))
8:31:09
johnnymacs
If the advice seems to be a corret way to solve my problem that I can understand then I follow it
8:31:24
johnnymacs
Somtimes people have the correct answer but they refuse to explain it in simple terms
8:31:40
johnnymacs
or for example some people want to have a conversation with you before they will tell you what they think the answer is
8:31:58
beach
johnnymacs: It would be very helpful if you acknowledged that you received the advice, and if you don't intend to following, indicate why.
8:33:19
beach
johnnymacs: "WHILE Y" indicates to the reader that Y is a Boolean variable. In reality, here it is a list. The expectations of the reader are thus violated.
8:33:42
jackdaniel
johnnymacs: if you are not willing to listen to advices you get (without saying why), then you simply waste people time by asking questions.
8:34:37
beach
johnnymacs: This solution has the additional advantage that you won't modify the parameter Y, which makes debugging easier.
8:35:28
beach
johnnymacs: I am attempting a few more times to give you advice. But, pretty soon, I'll give up unless I see some reaction.
8:41:27
beach
johnnymacs: If you can't read a specification, perhaps you should choose some other activity.
8:44:41
beach
johnnymacs: Some of us help in the hopes that you will become autonomous one day. What you are saying now is that it will never happen.
8:45:13
beach
Being able to read the specification yourself, rather than having people here read it for you.
8:45:24
jackdaniel
that doesn't mean you deserve help. if you need tutor who will explain things to you (without doing your homework), you probably need to hire somebody
8:46:18
johnnymacs
The common lisp hyperspec is like a cheap rag compared to a document like gentle introduction to lisp
8:47:42
johnnymacs
I think the hyperspec is the single worst piece of documentation I've read. I've read documentation ten lines long that taught more.
8:51:05
jackdaniel
you see, nobody here is a teacher (at least doesn't spend time on IRC to fulfill teaching duties, just to hang around with people with similar interests)
8:52:21
johnnymacs
if you didn't want to answer my question then why would you half assedly participate in answering them
8:52:32
antoszka
johnnymacs: I'm sure you had suggestions on *teaching* books (since you mention Gentle Intro and PCL which are both excellent books).
8:52:32
Shinmera
beach: Fwiw in my experience people that don't start out autonomous hardly ever become autonomous.
8:53:52
antoszka
johnnymacs: I only just look at the channel, I'm not in-any-part-assedly participating, I'm not in fact participating at all. Just wrote my opinion on the Hyperspec.
8:53:58
jackdaniel
1) being polite is something many people do; 2) we want to help if someone is willing to help himself - more lisp hackers = better; 3) I'm 100% sure you haven't read http://catb.org/~esr/faqs/smart-questions.html
8:54:38
beach
Shinmera: I think I know of some exceptions, but that doesn't falsify the general statement, of course. I still think it is an interesting observation, and I'll think about it myself.
8:55:41
johnnymacs
jackdaniel: that seems like alot of preparation simply to type some characters and then put a question mark at the end.
8:58:38
johnnymacs
I don't know I just feel like you guys have a high success rate at convincing people not to use the common lisp variant of a turing machine.
8:59:27
Shinmera
I feel like you're very disrespectful about the courtesy people have given you here.
10:27:09
easye
I am not sure that this function is in the ASDF manual. I probably found it by inspecting the exported symbols of the ASDF package via M-x slime-apropos-package
10:27:47
myrkraverk
Just performed compiling #<MADEIRA-PORT "linedit" "ports" "ccl"> but failed to mark it done
10:30:08
easye
It seems to indicate that ASDF attempted the compilation of the "ccl.lisp" source unit, but failed in some way. If you are running under SBCL, it is probably difficult to compile the presumably CCL specific code in that file.
10:32:25
easye
I have no experience with linedit, so I cannot help you on that. You have the source: examine the ASDF system definitions. Look for assumptions about what feature conditionals are active under different implementations.
10:33:31
jackdaniel
myrkraverk: I've witnessed ASDF3's :if-feature being buggy, so if thre is :if-feature "ccl" you may try replacing it with good old #+ccl before (:file …)
10:41:37
antoszka
I'd be happy myself to know if somebody has investigated broken linedit on recent sbcl and has a solution :)
10:43:16
scymtym
iirc, linedit uses madeira-port to conditionally include certain files based on the lisp implementation (it probably predates :if-feature). madeira-port doesn't work right with recent ASDF versions. i seem to recall that somebody is already working in this, though
10:44:41
antoszka
that'd be cool, I really like using linedit as a quick handy alternative to firing up emacs + slime
11:21:27
myrkraverk
I'm actually a bit more likely to make a new frontend with cffi and libtecla than fix linedit; at least if fixing linedit is hard.
11:51:17
myrkraverk
jackdaniel: you mean the innards of it? I haven't dared to look at them, myself.