freenode/#lisp - IRC Chatlog
Search
22:01:25
Bike
what you really need is the initfunctions, so that lexical environments don't get weird
22:09:45
void_pointer
Guess that means I will finally have to dive into the MOP, or just tolerate that it is possible to initialize class instances into an invalid state or just make all initforms for slots that need to be validated call error so that the arguments must be given explicitly and then can be checked.
22:15:33
void_pointer
jasom: the issue I am still having is that initargs is nil since the class uses an initform for the slot
22:16:02
void_pointer
jasom: though maybe this just tells me that I shouldn't have default values in the initform and just errors in them
22:20:33
jasom
void_pointer: just do an :around method and check that everything is correct after doing a call-next-method
23:21:48
fiddlerwoaroof
Has anoyone run into an issue with static-program-op from cffi being unable to find main?
23:22:56
fiddlerwoaroof
(my "build script" is here: https://github.com/fiddlerwoaroof/daydreamer/blob/master/build.lisp#L35 )
0:15:55
void_pointer
jasom, pjb, and Bike: found a decent way to do it that isn't too much of a hack with an :after method for initialize-instance. assert takes places, so it isn't limited to just variables. So one just uses with-slots for the slots and then uses asserts on the various slots which will do the checks and allow the user to input new values for any that fail while updating the slots to the user given values.
0:43:05
jcowan
void_pointer: that would only work if all the asserts are done all over after the restarts, no?
0:46:14
void_pointer
jcowan: depends on how coupled the asserts are. If the coupling is only mild, then it would be possible to have an assert handle two or three coupled parameters together
3:07:02
fiddlerwoaroof
PuercoPop: interesting, I came up with a more complicated solution involving output-files
3:15:11
fiddlerwoaroof
If you're on a platform that clisp supports but sbcl doesn't, you don't have a choice, really
3:20:25
PuercoPop
fiddlerwoaroof: build-pathname worked for me, but I've only used it twice. I don't remember where I cargo culted it from though
3:33:43
fiddlerwoaroof
PuercoPop: cool, I'm just trying to figure out how I can get travis to build a binary with no dependencies on the system so I can upload it to github
3:34:26
fiddlerwoaroof
I've figured out how to get the static-program-op thing that CFFI provides working, but I'm still working on not depending on osicat's shared library
3:50:13
redrapscallion
If I want to turn a list like (( (1 2 3) (4 5 6) (7 8 9) )) into (( (7 1 2 3) (7 4 5 6) (7 7 8 9) )), so just adding a 7 in front of each of those nested lists, is there any easy way to do this?
4:06:06
fiddlerwoaroof
Does anyone have any tips about making redistributable images that depend on shared libraries?
7:09:33
pjb
no-defun-allowed: loop is nice, but: (list (mapcar (lambda (list) (cons 7 list)) (first '(( (1 2 3) (4 5 6) (7 8 9) ))))) #| --> (((7 1 2 3) (7 4 5 6) (7 7 8 9))) |#
7:10:34
pjb
no-defun-allowed: You can also use curry: (list (mapcar (curry (function cons) 7) (first '(( (1 2 3) (4 5 6) (7 8 9) ))))) #| --> (((7 1 2 3) (7 4 5 6) (7 7 8 9))) |#
7:11:19
pjb
no-defun-allowed: in any case, this lets you see more easily that we just add 7 to each sublist.
8:34:36
no-defun-allowed
cl-yacc seems the nicest so far, but i still have to write the lexer myself.
8:35:44
no-defun-allowed
i'd like to write an editor which basically runs on ASTs instead of text, but i'd like to handle languages other than lisp
8:37:30
no-defun-allowed
the next simplest syntax i can think of which is somewhat irregular would be smalltalk, so i'll have a go writing syntax for that
8:58:14
pjb
no-defun-allowed: why your first step wasn't to ask cliki? https://cliki.net/site/search?query=parser+generator
9:04:40
no-defun-allowed
also beach is on the second page so i'm not sure if the other four pages are any good
9:04:58
pjb
Of course you must refine, asking for a specific kind of parser generatlr, like, LR, LALR, RD, Earley, etc.
9:05:55
pjb
no-defun-allowed: Zebu is nice because it uses itself to parse the grammar. So if you want strict BNF grammar, you can define the parser to parse it, and then use it to write the grammars of the languages you want to parse.
9:20:36
fiddlerwoaroof
Anyways, I've figured out how to use static-program-op to remove the dependency
9:29:27
pjb
Post bug reports to the authors' of the library, because they didn't use logical pathnames and give a chance to the user you are.
9:50:34
flip214
fiddlerwoaroof: in one of my projects, just before writing the core I do (cffi:close-foreign-library :libosicat)
9:54:33
jackdaniel
hint: if you do the same trick with cl+ssl you also need to call cl+ssl:reload after loading all ffi libraries anew
9:56:54
fiddlerwoaroof
If I build sbcl with the linkable runtime, etc, I can statically link osicat into the dumped image and not depend on the shared object at all