12:53:09XachHmm, is this ok? (defun starts-with (subseq seq test) (and (<= (length subseq) (length seq)) (every test subseq seq))?
12:53:41XachI've done endless variations of a starts-with thing and I don't remember using this. (e.g. mismatch, :start and :end with string= and stuff, etc)
16:29:22dimyou need to parse the file down to single statements
16:30:11dimyou can use my code for that from pgloader at https://github.com/dimitri/pgloader/blob/master/src/utils/read-sql-files.lisp
16:30:46dimphoe: the reason why it fails is that Postmodern is using the PostgreSQL extended query protocol which works with a query at a time, with out-of-line parameters (good to avoid SQL injections)
16:31:03dimthe trade-off is that you then need to make sure in the app that you're sending one query at a time using that protocol
16:32:05dimhttps://github.com/dimitri/pgloader/blob/master/src/utils/read-sql-files.lisp implements a simple hand-written parser for SQL queries delited with a semi-colon (;)... not that simple, it knows about dollar-quoting and other forms of escaping
16:32:58dimselect E'\';' as ";"; is an example of a corner-case when parsing SQL queries from a file
16:33:17dimthe result is a single value '; in a column named ;
16:42:58jackdanieldim: did you see my yesterday's comment?
16:49:24jackdanielsure, let me know if that helped
17:00:46dimThere is no package with the name PGLOADER
17:00:54dimok I'm not sure what gets into the binary I'm preparing
17:02:14dimjackdaniel: http://paste.debian.net/1074118/ if you want to have a look, but don't allocate time for that, I was just curious about building pgloader with ECL that's all
17:02:27jmercouriswhy does (string-downcase nil) return "nil", is there a more sensible function that will actually return nil?
17:03:19dlowestrings designators (which include symbols) are converted to strings if they are not strings
17:03:21beachjmercouris: What is wrong with what it does?
17:50:24shka_declaim inline here and there, replaced few defmethod with defun, replaced one class with struct, changed few internal functions
17:50:46shka_most of it is no big deal, but it is more rigid now
17:51:20shka_so it may interfere with overall design
17:51:48shka_and not many people here seems to have some jumbo csv files
18:08:32phoedim: does it mean that I likely won't get a (postmodern:execute-file #p"/home/phoe/foo.sql")?
18:09:18phoeit doesn't make much sense to me - in order to execute a SQL file, I need to either parse and digest it, or drop all the way down to bash to execute "psql < foo.sql"
18:10:21phoejmercouris: (check-type x string) (string-downcase x)
19:25:05phoedim: https://github.com/phoe/postmodern-execute-file that's a hack that works well for me.
20:44:04moldybitsif obj is an instance of a class defined in package P, and i want to get or set the slot value, i have to (slot-value obj 'P::slotname). hm ...
20:46:41scymtymmoldybits: you would normally use an accessor (whose name would normally be exported from P)
20:48:47scymtymi.e. for (defpackage #:p (:use #:cl) (:export #:name)) (in-package #:p) (defclass c () ((name :accessor name))) you would have something like (in-package #:p2) (p:name obj) (setf (p:name obj) value)
20:49:31moldybitsi'm using my own setter so that i can store the modifications done to the object in a history list. i could :before all the setting accessors, or maybe there's even a way to do it for all of them, but that'd hide the magic. hm.
20:50:29moldybitsone option would be to take whatever symbol is passed in an get the corresponding one in P.
20:50:51phoemoldybits: modification list sounds like a use case for :before on a setter
20:53:06moldybitsthere's no way to :before all the slot setters of a class, is there?
20:53:39phoemoldybits: sounds like you want a metaclass then
20:54:58moldybitsi don't know what those are. i'm reading keene's book, though. hopefully she'll cover it. :p
20:56:19phoemoldybits: you'll want to get into metaprogramming. see, in Lisp, classes are just objects like all other objects, and you can modify them like all other objects.
20:56:55phoesuch as, you can modify an instance's slots so they record their setting history.
21:02:55phoemoldybits: that'll allow you to do things like https://plaster.tymoon.eu/view/1267#1267
21:03:19phoeand then access a given slot's history via some other function you define