Search
Sunday, 12th of May 2019, 21:48:08 UTC
22:05:31
jgkamat
does anyone know if it's possible to attach some data to a function somehow? Like a marker or something, on the function itself.
22:08:29
krwq
jgkamat: I think people usually use hash-table and define a macro which auto-adds something there
22:08:56
jgkamat
hmm, ok, that was my backup plan
22:09:23
krwq
jgkamat: how would attaching data to a function work?
22:10:39
jgkamat
in python, you can do it. Basically function.data = "foo" and "foo" == funciton.data. Maybe something like (getf #'my-function 'data)
22:12:12
no-defun-allowed
if all the functions have names, you can use symbol plists
22:15:58
saturn2
jgkamat: there are funcallable-instances http://metamodular.com/CLOS-MOP/funcallable-instances.html
22:16:24
jgkamat
ooh that's interesting saturn2
22:16:42
saturn2
you can also make a closure like (let ((data "foo")) (defun x ...))
22:17:10
jgkamat
if I do the closure is there a way to get the data (from outside the function)
22:17:50
krwq
you can define two functions in the same closure and call one of them and use other one to retrieve data
22:18:57
jgkamat
I think this funcallable instance thing is the way to go though
22:19:54
krwq
https://pastebin.com/HF9WP2GC
22:20:13
krwq
you likely won't need to do that if you do something along those lines
22:20:47
Jachy
jgkamat: Property lists? (defun fun-foo () ...) (setf (get 'fun-foo 'data) "foo") (get 'fun-foo 'data) ;-> "foo"
22:23:18
jgkamat
wait you can just do that, one sec
22:24:08
jgkamat
woaaaaaah nice, this is exactly what I wanted :]
22:25:12
jgkamat
hmm, actually, is there a way to pass the function instead of a symbol in to get the data
22:25:33
jgkamat
maybe I should figure out what get is doing
22:26:01
saturn2
no, property lists are attached to symbols, not functions
22:49:59
Jachy
jgkamat: Maybe the other way around, see what defun/function/symbol-function are doing ;) I suppose you could add a wrapper that asserted that the given symbol was fboundp if you wanted to make sure you can also associate a function from the symbol.
23:38:26
Lord_of_Life_
** NICK Lord_of_Life
2:58:37
beach
Good morning everyone!
5:26:22
gjvc
I am using emacs and slime. (merge-pathnames "myfile-.xml" *compile-truename*) is returning something in /tmp not in my source directory
5:28:30
gjvc
how can I make the compiled lisp files reference the source directory, not /tmp ?
5:29:36
edgar-rft
gjvc: have you already tried *load-truename* ?
5:30:23
loke`
gjvc: (asdf:system-relative-pathname (asdf:find-system :name-of-system) "filename")
5:30:54
loke`
load-truename and compile-truename is an absolute nightmare to get right.
5:31:15
loke`
Using the ASDF facility works very well
5:31:54
gjvc
ok, i need an .asd file as well, then
5:32:30
gjvc
i have a genesis.asd file atm
5:32:33
gjvc
(defsystem :ds-gate-genesis :class require-system)
5:41:40
gjvc
looking up how to write a proper (defsystem) form now
5:44:15
loke`
gjvc: I recommend you do create an ASD file and then load the project through Quicklisp
5:44:24
loke`
Even for single-file projects, it help immensly.
5:44:39
gjvc
really, ok, thank you i will folow that advice
8:48:29
svillemot
** NICK svillemot_
8:59:45
heisig
The ELS'18 recordings are finally available: https://29660.net/2018-04-european-lisp-symposium.html
9:00:29
heisig
Most are still audio-only, but the videos will follow soon-ish.
9:09:31
beach
Some talks are incorrectly labeled.
9:09:47
beach
Alex Wood and Irene Durand were not present at the conference.
9:13:48
aeth
"good morning" at 00:41 https://29660.net/els2018/sound/01%20-%201200%20-%20IncrementalParsing%20-%20RobertStrandh_mono.mp3
9:14:49
aeth
hmm, I might want to wait for the videos.
9:16:59
schweers
Cool, thanks for these heisig! Also obviously a big thanks to everyone who contributed to this.
9:17:45
aeth
are the slides somewhere?
9:18:18
schweers
aeth: https://european-lisp-symposium.org/2018/index.html
9:18:34
schweers
It seems not for every talk, but for some.
9:21:09
aeth
oh, I was there but didn't realize those links were slides
Monday, 13th of May 2019, 9:48:08 UTC