freenode/#lisp - IRC Chatlog
Search
14:43:45
pjb
flip214: why isn't flying to Malaga not easy? Depending on the flight company, going to Gibraltar may be easier (and not farther to Marbella than Malaga).
17:13:41
pagnol
I have entities and every entity has key-value pairs and I want to store them persistently on disk
17:14:38
pagnol
in my case there are entity types, too, an entity type says which key-value pairs an entity must have and of which type the values must have
17:22:09
Shinmera
pagnol: As I understand it from your explanation you have some kind of object that acts as an entity and you'd like to persist them to disk, yeah?
17:25:12
Shinmera
If you need to have it automatically persist to disk when a change in any of the values occurs then things get more complicated of course.
17:26:57
pagnol
I have an existing program that I want to rewrite and which is relying on an rdbms with a messy eav-like layout, and I was looking at the problem from that angle
17:29:02
Shinmera
Okey. Well, there's multiple libraries for RDBMs interaction or RDBMs-like things. If you want something more lispy, perhaps have a look at Rucksack. https://github.com/arieltan/rucksack/blob/master/doc/rucksack-tutorial.lisp
17:30:40
pagnol
I was hoping to find something that gives me ACID and also lets me enforce the schema without having to write a lot of code myself, especially the validity of entity references
17:32:05
pagnol
btw I will be using this only from lisp, so the potential lack of implementations in other languages is not an issue
17:33:03
tazjin
pagnol: I'm only using it for a little toy project, for "real" things I use postgres, but cl-prevalence works well
17:37:03
tazjin
because the main problem with the concept is that things like web apps have waaay too much friction
17:50:19
tazjin
pagnol: well, I basically want to translate the UI of the web app into a physical thing - the fun part is that I know nothing about "making" (in the sense of building physical tech), so this is a cool side project
17:50:55
tazjin
pagnol: the idea is to have a sort of board with the tasks on it, where on the backend the tasks are now linked to slots on the physical board, and then there's indicator LEDs for the red/green/yellow statuses and an actual physical button for resetting the completion timer of each task
18:04:55
pagnol
tazjin, I've also always wanted to learn how to make actual physical devices that do something... I wish you luck
18:05:18
tazjin
we have a nice makerspace here in Oslo that I'm going to be consulting to get some help :P
18:07:04
tazjin
you mean hardware-wise? I don't really know yet, I've only done some sketching of how I want things to be.
18:07:27
tazjin
I have an Arduino starter kit somewhere that I never got around to using for anything so that's probably a good entrypoint
18:07:57
pagnol
Shinmera, thanks for suggesting rucksack earlier, I'm going to play around with it a little
18:08:35
pagnol
building a project on it seems like a somewhat risky undertaking though, given that it hasn't been maintained in the past 7 years
18:22:55
jackdaniel
I'm a big fan of `collecting' macro from cmu utilities, it unties collection from loop construct and is very handy
18:28:06
Shinmera
Here's another version :^) (prog((i n))x(and(< 0 i)(decf i)(read-line s NIL)(go x)))
18:29:14
Shinmera
Actually this is even better: (prog((i 3))i(and(< 0 i)(decf i)(read-line s NIL)(go i)))
18:30:06
Shinmera
well, change the 3 to an n, but you get the point. (the point is you shouldn't use this)
18:34:48
Shinmera
The hidden point is that I like to write intentionally obtuse answers to simple questions.
18:39:00
_death
(define-symbol-macro _ (progn (format t "Enter a specific number: ") (force-output) (read))) ;; you know the rest
18:53:05
Bike
"how they're used" covers a lot of things. is there something in particular that you want to do?
18:53:59
_death
you can check out http://infolab.stanford.edu/~paepcke/shared-documents/bibliography.html search "metaobject" (there is more than one paper)
18:57:30
pagnol
I was wondering if/how I could use mop for my current project in which I load a schema definition on startup, which is then used to check if certain objects that are created are conformant
18:59:01
pagnol
when the program attempts to update a slot, then the ... metaclass? ... would look at the schema to find out if it's ok
19:00:11
Bike
here's a start: define some class and then do (describe (find-class your-class)) and get a look at things
19:23:00
makomo
pagnol: what about the book The Art of the Metaobject Protocol (AMOP)? i didn't open the book yet, but it sounds like it might be useful?
19:30:59
pagnol
makomo, I have a copy of the book and skimmed the first few chapters but I feel I would need to set some time aside specifically for studying the MOP to get anything out of it
19:36:15
pagnol
I found a good tutorial here in case anyone cares: http://www.drdobbs.com/parallel/lisp-classes-in-the-metaobject-protocol/200000266?pgno=5
20:19:23
fiveop
Is there an idomatic name for the function that is similar to SOME, but checks elements of trees instead of sequences? Does Alexandria have such a function?
20:22:48
makomo
pagnol: oh, nope, but i want to learn more about it because (1) it's very interesting and (2) i've been doing some java/spring recently and am interested in the comparison between the two
20:23:42
fiveop
phoe: that would work, if I thought the thing through properly. I do not only want to check the atoms, but the three itself and its subtrees as well.
20:24:05
phoe
fiveop: ooh, i see. do you want some kind of tree traversal and apply the predicate to each tree node?
20:24:27
phoe
I think nothing in the standard or in Alexandria is suited for that. Feel free to roll your own.
21:34:44
Shinmera
pagnol: I implement a metaclass that does strict type checking on slots for my chat protocol specification