freenode/#lisp - IRC Chatlog
Search
4:13:39
pjb
cnomad: in the golden age of Internet, you could just do whois lispm.de # but this time has been over for a long time, since the spammers, etc.
12:00:57
no-defun-allowed
That's definitely good practice, since then users can subclass those classes and create them dynamically.
12:01:34
pjb
fivo: you cannot export classes in lisp from anything (in the CL standard; you can always invent your own concepts).
12:03:07
fivo
ok, so it's no possible to just export the symbol of a class and have access to all the readers/writers
12:03:34
pjb
fivo: what this tutorial means to convey, is that you should define and document your own API. It is valid to define make-instance '<your-class> as the API to instanciate objects of your class, and to specify that they're CLOS object.
12:04:26
pjb
fivo: but if you could want to implement them as structures or as something else (eg. a reference in a database, a handle), then you may want not to publicise the fact that they're clos objects and it's a class.
12:05:02
pjb
fivo: in that case, you would define your API in terms of functions such as make-person, instead of a clos class with a constructor such as make-instance 'person.
12:05:54
pjb
fivo: and yes, you get to choose the precise list of accessors you want to export. Some accessors may be "private".
12:07:19
pjb
Since CL is a lisp-n, (cf. lisp-2 vs. lisp-1) a symbol can name several things. When you export it, thru it you give access to all the things it names.
12:11:17
fivo
ok so there is no mechanism to automatically export all accessors whenever I export the symbol of clos class? (maybe also for a good reason)
12:32:52
selwyn
fivo: you may be interested in cl-annot https://github.com/m2ym/cl-annot#annotation-export-accessors which provides this functionality with read macros
12:33:44
beach
pjb: There is no such thing in the Common Lisp HyperSpec as a "CLOS object". The only reasonable meaning of such a term would be equivalent to "object" or "datum".
12:34:31
beach
fivo: Yes, very good reasons. You almost never want to do that, so the functionality is fairly limited.
12:35:30
_death
you may also be interested in this: (defun thoughtful-export (symbols &optional (package *package*)) (dolist (symbol symbols) (when (y-or-n-p "Do you really want to export the symbol ~S?" symbol) (export symbol package))))
12:36:23
_death
you should think about the external interface first, instead of automatically exporting symbols
12:37:47
p_l
fivo: also, package nicknames, and available in some systems package-local-nicknames, allow you nice shortnames that help with things
12:38:15
katco
can anyone recommend a common-lisp equivalent to pandas? the only one i can find that appears similar is cl-ana http://pandas.pydata.org/
12:39:10
p_l
Josh_2: it's good to think on external interface, including which symbols need to be qualified
12:39:22
beach
There is no problem exporting names of classes, especially if you want client code to be able to subclass, define :AROUND methods, etc.
12:40:15
beach
Josh_2: As several people pointed out, it is not whether it's a class or not that counts, but whether the entity is part of the external protocol.
12:41:52
beach
Josh_2: The stuff you want to present to client code. Called API or Interface in other contexts.
12:43:58
beach
Josh_2: There is no problem. If your symbol names something that is part of the protocol, then export it, otherwise not.
12:48:50
Nilby
_death: lol, I think I need to make the whole thoughtfull-* suite, especially thoughtfull-defsystem, and thoughtfull-setf
12:55:57
_death
you can also add (unless (documentedp symbol) (setf (docstring symbol) (prompt "Please enter documentation for ~S:" symbol)))
13:18:05
pjb
beach: object and datum include objects of build-in classes. What I mean by CLOS objects are instances of standard-object; there remains instances of user-defined standard-classes.
13:23:36
pjb
katco: why would anybody want an equivalent of pandas? They're stupid, lazy, evil, gluttonous, (and they eat something they're not supposed to eat), they don't reproduce, and they cost a lot of CO₂, being shuffled around in planes.
13:24:28
pjb
_death: (unless (documentation symbol t) (setf (documentation symbol t) (prompt "Please enter documentation for ~S:" symbol)))
13:25:44
beach
pjb: I know what you mean, but it is better to use the established terminology, i.e. standard object.
13:49:18
beach
iarebatman: It is a much better strategy to describe what you need. Then people who do not know the language you are referring to can also help out.
13:51:45
iarebatman
beach: Thanks for the tip. Is there a convenient way to traverse an alist/plist depth-wise to get at a value at a certain 'path' ? ex, instead of nesting several (cdr (assoc))s, something like (get-in alist '(:first :second :value-of-second))
13:56:29
Xach
iarebatman: in my experience it is not so common to construct objects that require key path lookup like that in CL, and I don't know of a popular library to do it. (it seems pretty common when processing e.g. json though)
14:02:53
Josh_2
Is there a guide somewhere that explains in laymans terms how the heck to deploy an app in CL and why certain steps have to be taken. I've deployed before but never anything more than like 100lines of cl
14:04:30
Josh_2
Well I have an app that I have made and I tried to dump the image but it isn't functioning properly
14:05:20
Josh_2
It's not functioning properly when dumped. pjb has gone over some things with me but I was hoping there would be a nice guide that explains why things are the way they are
14:05:30
iarebatman
Josh_2: I'm definitely no expert in CL, but I was able to easily build a native executable with buildapp
14:09:25
Xach
Josh_2: the commercial implementations have guides to deployment/delivery but they don't directly apply to other implementations
14:12:30
fivo
iarebatman: If you want to parse json, you might want to look at https://github.com/hanshuebner/yason
14:13:06
Josh_2
with buildapp I specify the location of the --asdf-path and then name the package I created with --load-system ?
14:13:38
Xach
Josh_2: --load-system is for loading systems - systems usually load files that define packages.
14:17:42
Xach
i have one rule that builds the project with Quicklisp, that means all the prerequisites are available. the next rule dumps a quicklisp system manifest file. the next rule uses that manifest to build my program binary.
14:19:51
iarebatman
fivo: the parsing is fine with cl-json, it’s after it’s been turned into cl representation that I was looking for a better way to extract nested values
14:22:55
mfiano
Keep in mind that you have to explicitly unload any foreign code that is loaded in the image prior to dumping it, and then re-open the libraries in a function called on initialization. You can't dump the path CFFI used to load the library on *your* system.
14:26:46
Josh_2
Basically when I load normally with asdf in sly I have no problems, if I use a function to load the asdf then dump the image the server doesn't work properly, tcp seems to work but udp doesn't
14:27:35
Josh_2
because when I move my fingers on my android screen, normally repl spews tons of output :P
14:29:14
Xach
Josh_2: i don't think there is a general guide, just practice and troubleshooting, sorry.
14:29:23
Josh_2
Xach when I finish eating I will demonstrate how I create the image etc and what happens