freenode/#lisp - IRC Chatlog
Search
22:57:27
jfrancis_
Technically a slime question, not a CL question, but still relevant. Slime is getting angry because I'm getting a returned string containing non-UTF-8 characters. Specifically, I'm getting the error "Invalid protocol message: Error during string-to-utf8: Unable to encode character 55357 as :UTF-8.". That's all true and accurate. But I don't care. Is there any way to tell slime to show me anyway, and just go ahead and munge 55357 on my screen i
23:00:15
jfrancis_
Mmm... You mean patch the slime source with an (ignore-errors ...) around the display code? I was hoping for something a bit less brute-force.
23:43:05
jasom
skidd0: you can do shadowing-import-from; uiop also defines its own version of defpackage where you can do imports of packages with no conflicts order matters)
23:46:34
skidd0
jasom: so shadowing-import-from explicitly defines which symbol to use, avoiding the name conflict, right?
2:24:25
stacksmith
G'morn... Has anyone experinced SBCL all of a sudden no longer saving lambda-lists - but only for some code? And recompiling does not help...
3:21:45
skidd0
so coming from Flask and Python, I've used SQLAlchemy as an ORM for a database. With CL, does an ORM provide as much of a benefit to the programmer?
3:22:32
skidd0
by that i mean, ORMs help make querying through database logic faster/easier to write (compared to SQL queries).
3:44:10
aeth
skidd0: The CL solution is often a linguistic solution instead of a directly OOP solution. e.g. for Postmodern (postgresql), http://marijnhaverbeke.nl/postmodern/s-sql.html
4:15:38
sabrac
skidd0: I cannot offer ORM recommendations pro or con as I use straight SQL (or s-sql) but you might look at mito and see if it works for you.
4:29:01
sabrac
skidd0: It really depends on what you want an ORM to do for you and the complexity of your data relationships and how well you understand them. I write functions with embedded s-sql calls that probably do the same thing you would do with an ORM.
4:49:38
skidd0
and my intuition was the, due to lisp's "power", ORMs are less of an improvement compared to other offerings
4:51:23
sabrac
skidd0: obligatory disclaimer - I am the maintainer for Postmodern (and thus s-sql). It is again under active development so if there is something you want, set up an issue on the github https://github.com/marijnh/Postmodern
5:01:04
panji
I finally satisfied with project i made for learning common lisp (https://github.com/epanji/decision-tree). if anyone here willing to give advice or criticize it, please do. but, please don't be so harsh to make me break down. :-)
5:09:05
sabrac
panji: I do not have time to review the code tonight, but I certainly want to congratulate you for documenting, testing and even a youtube video demo!
8:18:56
shka
is it possible to open mcclim application on remote machine, but display window on local machine?
8:19:48
theemacsshibe[m]
if you ssh in, do `ssh -Y` then your usual arguments to make ssh forward X over and set DISPLAY appropriately
9:18:22
phoe_
I am making instances of some class via MAKE-INSTANCE. These instances are named, in a way similar to class metaobjects - each instance has a name, and they are referred to by their names.
9:18:58
phoe_
At the moment, I have an INITIALIZE-INSTANCE :AFTER method that automatically registers each instance after it's created, but it doesn't seem right to me.
9:19:47
phoe_
For example, this doesn't allow me to make anonymous instances, and seems inconsistent with how I can do (MAKE-INSTANCE 'CLASS) that doesn't seem to have any side effects.
9:20:27
phoe_
Should I instead write it so MAKE-INSTANCE only returns the instance, and the task of "registering" that instance is delegated to some macro?
9:20:29
pjb
phoe_: it is perfectly right for a class to keep track of its instances. This can be done with this :after method.\
9:21:10
pjb
phoe_: the question for you, is whether you may need to have several trackings, if you need different sets of those instances.
9:21:41
pjb
If you just want all the instances of that class (and subclasses), then tracking them from initialize-instance :after is ok.
9:21:46
phoe_
pjb: I don't think so, the way I think of it is, a symbol is going to name one and only one instance ever.
9:22:11
pjb
or initialize-instance, rather, because I would reserve :after and :before to the client of a class or library, but it's just an API choice.
9:23:54
pjb
(let ((i (make-instance 'class))) (register i :name 'foo :namespace 'china) (register i :name 'jean-pierre :namespace 'france))
9:24:32
pjb
And define-named-class-instance can expand to (register (make-instance 'class) :name name :namespace 'global)
9:25:26
pjb
Do you want also to have bindings? I would use a define macro only if it created a (variable or symbol-macro) binding.
9:26:09
pjb
Once I parsed a mail.log, and bound all the data about a given message to variables named after the message-id (in a specific package).
9:26:36
_death
I think a macro is ok here.. it could expand to (setf (find-foo ...) ...) or ensure-foo that does it
9:28:50
jmercouris
so in reading Gentle introduction to symbolic computation I came across this: "FUNCTION returns the functional interpretation of its unevaluated argument"
9:30:54
pjb
it means that you cannot write (function (intern "FOO")) but you have to write (function foo).
9:31:37
pjb
but when QUOTE returns the argument as-is, FUNCTION returns the actual function object that is named by the argumnet.
9:32:11
shka
the only thing in common, really is that they are both special, and both won't evaluate it's argumetns
9:32:45
pjb
jmercouris: now, the difference is when you have local functions (ie. closures). (funcall (quote foo)) will always call the global function named foo, stored in (symbol-function 'foo). On the other hand, (funcall (function foo)) will call the local function foo, when there is one.
9:33:36
pjb
jmercouris: (defun foo () 'global) (flet ((foo () 'local)) (list (funcall (quote foo)) (funcall (function foo)))) #| --> (global local) |#
9:34:16
_death
there is also the case of (function (lambda ...)) which returns a functional object for the lambda expression
9:34:21
pjb
jmercouris: so outside of a lexical scope where you have local functions, using 'foo or #'foo is mostly semantically equivalent.
9:34:51
pjb
(function foo) makes reference to the flet foo. (quote foo) makes reference to the defun foo.
9:35:36
jmercouris
beach: I remember the conversation we had, which is why I was wondering about this as well
9:36:04
jmercouris
the author again goes on to say, "If the argument is a symbol, it generally returns the contents of the symbol's funciton cell."
9:36:16
pjb
jmercouris: read again, global is just a symbol. The returned result after "-->" is data.
9:36:34
beach
jmercouris: (function bla) returns the function with the name bla. There does not have to be any function cell.
9:37:13
pjb
jmercouris: notaly, as a special operator function creates closure objects: (let ((y 42)) (function (lambda (x) (+ x y)))) #| --> #<ccl:compiled-lexical-closure #x302002617AEF> |#
9:42:25
jmercouris
the PDF is freely available on the CMU website I believe, I wonder if it would be legal to publish a set of revisions based on the book
9:42:41
jackdaniel
afaik he responds to emails; someone asked me how to fix clx for some Gentle example and he has asked the author if he can modify his code before that (with positive answer)
9:46:17
_death
I think it's a pedagogical style where simplicity is more valued than correctness.. where they don't want to "bog you down with the details".. this may work for some people, especially if they don't rely on it as the only source of information.. the CLHS is the authoritative source nowadays (with small exceptions agreed upon by community and implementations)
9:46:52
jmercouris
since ASDF is not part of the spec (I believe), why was it integrated into most popular implementations?
9:47:17
_death
and it may be that the misconception will be corrected later on in the book.. if you're bothered by such things, gentle may not be the right book for you.. I think PCL tries to be more strict in that regard
9:48:33
_death
jmercouris: because it solved a real problem and had many users.. then it evolved into a little monster :)
9:49:45
jmercouris
_death: I like this book, even if it would be potentially simplifying things for me, it is a nice cover to cover read
9:50:35
jmercouris
_death: I'm on page 226, and I still manage to read every day, since it isn't so heavy
9:51:08
jmercouris
jackdaniel: the difference here is that MAKE is a separate program, not part of the C++ compiler
9:51:12
_death
jmercouris: that's good.. so like I said, just treat it as one of several sources of information
9:52:19
jmercouris
beach: I assumed it was some extension added to SBCL, CCL, ETC, I didn't realize that it was a separate program that just ships with them when you install them
9:52:21
jackdaniel
LdBeth: I'm confused now, so I'll cease to read to avoid further confusion towards my day :-)
9:52:47
beach
jmercouris: You are not considering something a separate program if and only if it is in a separate Unix executable file do you?
9:53:12
jmercouris
beach: that is what I consider a separate program, otherwise I consider them part of the same system, and just different functionalities
9:53:21
beach
jmercouris: That would be silly because then all of the tools of Genera would be one single program.
9:53:34
jmercouris
is the save routine within a text editor a different program than the routine that handles inputting a keystroke?