freenode/lisp - IRC Chatlog
Search
20:57:32
astalla
It is a special operator, the evaluator and the compiler treat it specially. But yes, at the core you can imagine it as a function application.
20:59:11
jmercouris
and if we are to reimplement let ourselves, we'd have to use anonymous functions as closures?
20:59:31
astalla
No, it does not. It is special-cased by the compiler/evaluator. But conceptually, it works as if it were a function application - without the overhead.
21:01:07
pjb
dim: the solution is to prepare a chain of certificate up to the CA, and to specify it to cl+ssl so it can do the verification. Disabling the verifications defeats the purpose of using SSL!
21:01:28
jmercouris
Bike: a function that is enclosed by another, does it have access to the parent functions variables?
21:03:31
pjb
dim: here is an example of a script building a chain with some specific certificates; adapt it to your needs: https://github.com/informatimago/test/blob/master/ias-ecc/build-chaine2
21:06:09
jmercouris
and now I am trying to make something like with-result* and I can't figure out how to do it
21:08:58
Bike
(with-result* ((a (foo)) (b (bar a))) (baz b)) => (with-result (a (foo)) (with-result (b (bar a)) (baz b)))?
21:13:11
anamorphic
jmercouris: there is a book called Lisp in Small Pieces that will give you a better idea of implementation of lexical scope
21:49:49
dim
on my laptop it seems to be /etc/ssl/cert.pem, on this pgloader user's debian system there are 456 files in /etc/ssl/certs, and I need to fix the problem for any pgloader's user, now and future
21:50:10
dim
it need to just work, as works psql and many other apps just by default, without having me to do anything system specific each time
21:50:45
dim
it seems to always come at a surprise here that someone would ship software written in CL to users who know nothing about CL, sometimes I'm thinking I'm doing it wrong :/
21:53:03
dim
are we still talking about that programming language with a standard fixed in the 90s? it could be funny if it wasn't 2018 already
21:54:09
dim
now there's https://github.com/thusoy/postgres-mitm/blob/master/postgres_get_server_cert.py that apparently knows how to retrieve the cert rigth from a live connection/socket, but I'm not sure what to do with that
21:57:35
dim
anamorphic: pgloader, it's on github, it does many things related to loading data in PostgreSQL, including full database migrations
21:59:28
dim
it's less often that I tell it, and I still love the parts when I say that I searched for a modern programming language after having lost patience in the Python 2/3 situation ;-)
22:01:45
dim
it stops being funny when you're the only one who can't establish a secure connection in between a given client and server both having openssl available in the OS, believe me
22:03:05
dim
if I search for “postgresql X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY” 2 of the first page of answers on google are pgloader issues
22:03:09
anamorphic
Yeah I have postgres running here - maybe if you can post a lisp paste (?) Can try it out
22:04:19
dim
you can first do the following in your shell: psql postgres://localhost:5432/dbname?sslmode=require to see it working
22:12:59
anamorphic
dim: OK psql postgres://localhost:5432/template1 -U postgres sslmode=require sees to work
22:13:29
anamorphic
dim: do you happen to have a convienient postmodern code snippet handy? I've not used postmodern before
22:14:19
dim
oh, if I set cl+ssl:*make-ssl-client-stream-verify-default* to nil then it connects on the laptop it seems
22:14:40
dim
because otherwise it's like it still requires even if in the context you ask it not to... for reasons
22:16:43
dim
so as pjb said of course that breaks the whole idea of being secure, to a large extend, so it should not be the default
22:19:19
fiddlerwoaroof
minion: memo for schweers: this is probably entirely too late, but I wrote some code to allow defining anonymous generic functions that illustrates adding methods to a generic function https://github.com/fiddlerwoaroof/fwoar.lisputils/blob/master/glambda.lisp#L32
22:19:44
fiddlerwoaroof
I'm not sure if it's great code, and it's entirely undocumented since it was mostly a quick hack, but it did work.
22:20:23
anamorphic
dim: Well today I learned that postmodern has a lovely API. Previously I used CL-SQL
22:22:01
pjb
dim: I don't find any ssl stuff with my postgres installation; perhaps it uses openssl, and you'd have to look where openssl seeks the systemwide chain by default. Otherwise have a look at the documentation or sources; I'd guess you'll have to reproduce the code searching for that file in lisp…
22:26:16
dim
what PostgreSQL does is call SSL_set_verify(conn->ssl, SSL_VERIFY_PEER, verify_cb), that's it, so the rest lies in OpenSSL itself
22:28:26
dim
or I can expose the setting (cl+ssl:*make-ssl-client-stream-verify-default* nil) to the end user so that when then get CA failure they may choose to disable cert verification altogether
22:33:28
anamorphic
Was wondering if related to https://github.com/cl-plus-ssl/cl-plus-ssl/issues/54
22:34:06
dim
fiddlerwoaroof: my audience is people that know nothing about CL, restart isn't the right approach here, even though I love that they exist
22:35:16
fiddlerwoaroof
Well, you could use handler-bind to say something like "SSL Certificate Verification failed, retry with verification disabled?"
22:36:20
dim
it still feels wrong on many levels, but at least would render pgloader usable in some cases rather than none
22:36:47
fiddlerwoaroof
I dunno, I think it's pretty standard to use this sort of pattern in common lisp
22:37:20
fiddlerwoaroof
low level code signals a condition, libraries add recovery methods via restarts and your toplevel handles conditions and invokes the appropriate recovery method
22:39:05
pjb
housel: strace is not enough, it may have an algorithm looking in some data structure before trying to syscall.
22:41:36
pjb
Don't disable ssl verification. Teach people on how to install certificates, and make it easy to do.
22:43:34
dim
pjb: you're saying that as if you knew how to make it happen. any specific advice how to make it easy for CL on machines you're never supposed to log in?
22:57:29
dim
and now after like a dozen builds, I randomly get The alien function "CRYPTO_num_locks" is undefined.
22:59:15
dim
(oh ok I had removed a patch to src/hooks.lisp that fixes that problem on debian, but not sure if it's helpful on other OSes)
22:59:23
anamorphic
Man it sucks that you're running into probs... Is this one a matter of email cl+ssl maintainer, hey updated the .so.N version?
23:00:12
copec
What is the typical license for open projects that this community has gravitated towards?
23:03:47
pjb
dim: well, yes it may be difficult to know for random machines. That's why applications are bundled with their own certificate chains.
23:04:17
p_l
pjb: well, linux systems using openssl have somewhat standard location for "Web-friendly" list of CAs
23:04:39
pjb
dim: if you linked with libcrypto, check that the symbol is present in it. Otherwise, you may need a different version of openssl.
23:05:31
p_l
dim: best would be if system default store (on typical linux system, it's in /etc/ssl, is used
23:05:41
dim
pjb: this one is a classic of CL+SSL when used in an image that you restart, you need to (cl+ssl:reload) for reasons
23:34:11
jasom
So I was looking at low-hanging fruit on the benchmark game, and noticed that OCaml was desetroying sbcl on the binary-trees test (this is essentially a GC/allocation test). I peeked at the code, and it was forking a new process for each parallel task, thus *greatly* reducing the peak heap size for any process. Applying the same change to sbcl got a 3x speedup
23:36:52
jasom
no-defun-allowed: this is within the parameters of the benchmark; the liveness is defined for each item, and this does not change that
23:37:10
jasom
aeth: I thought inline assembly was no longer allowed (they changed the rules a bit in the past couple years)
23:39:14
aeth
jasom: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/mandelbrot-sbcl-1.html
23:40:38
aeth
Are libraries allowed? Because if there are you can't really avoid define-vop because some libraries can use it to provide a fast path for SBCL
23:42:48
Odin-
I mean, if there was, shouldn't there also be a rule against using optimisation directives?
23:43:13
aeth
Anyway, no matter what the rules are, what you wind up with is... basically... programs micro-optimized to the extent that you'll never, ever see in the wild, except maybe in a BLAS+LAPACK implementation or something (and *that* in itself might itself be gaming benchmarks in a sense because LAPACK is afaik often used to benchmark)
23:53:29
asdf_asdf_asdf
Hi. Did in Common Lisp are events? I want use: (event-control-left 25), but in Lisp not have events. In JS is: addEventListener?
23:56:09
asdf_asdf_asdf
I want in console CMD in Windows move (shift) letter "a" about 10 position in right for example.
0:02:12
Odin-
I don't think that name is usually used, but in JavaScript the term fundamentally means using callbacks from a central control loop.
0:02:57
fiddlerwoaroof
asdf_asdf_asdf: we probably need more context, but if you want an event loop there are libraries like cl-async
0:03:20
Odin-
I'm not quite sure what that has to do with Windows' console interface, but I haven't dealt with that ... ever, so that may be my ignorance talking.
0:03:32
fiddlerwoaroof
However, I suspect that you're misunderstanding how output in common lisp works
0:04:07
fiddlerwoaroof
By default, it's not like the browser where you position your words in a two-dimensional space.
0:04:34
fiddlerwoaroof
It's like a typewriter: every call to (format) or (princ) or related functions starts where the last one left off
0:05:25
fiddlerwoaroof
There are things like cl-charms that give a more webpage-like behavior, if that's what you want
0:08:07
asdf_asdf_asdf
OK. How shift letter "a" 10px position in right not using this: (defun a() (princ " ") (princ " ") ... (princ "a"))?
0:10:37
Odin-
And I think CMD.COM has some pretty drastic differences from the VT100-derived interfaces common in the Unix world.
0:12:37
asdf_asdf_asdf
I have windows console. And ... I want put letter "a" into position x,y. E.g. x=50, y = 100 using Common Lisp. Probably simple script.
0:14:52
p_l
to do it "right" you would need to read about Windows Console API, then link to it using FFI and call appropriate functions
0:14:54
Odin-
Well ... I don't know what the situation is on Windows, but doing that kind of thing portably is infamously tricky.
0:15:23
p_l
(cl-charms can actually do it for you when coupled with windows-capable ncurses library iirc)
0:20:49
asdf_asdf_asdf
Thanks, so how call function API cmd.exe using Common Lisp. I not want use external packages and libraries. I want standard package Common LIsp. I use SBCL.
0:20:52
Odin-
asdf_asdf_asdf: One thing to remember about writing JavaScript in the browser is that it has an astonishingly extensive support library for doing stuff with the web, far in excess of what comes with any other programming language.
0:27:00
fiddlerwoaroof
asdf_asdf_asdf: Common Lisp (and python, etc.) aren't really designed to make that easy
0:27:35
fiddlerwoaroof
Does the windows console support pixel offsets? or is it just a grid of characters?
0:28:51
asdf_asdf_asdf
Probably grid of characters. So i want call window and put letter "a" on position x, y. How do?
0:29:18
Odin-
The console probably doesn't, but it wouldn't surprise me if they still had DOS-era escapes to CGA and EGA modes...
0:30:23
fiddlerwoaroof
asdf_asdf_asdf: one thing you can do is, if the screen size is 80x25, print out 2000 characters with the desired characters in the right places
0:31:14
fiddlerwoaroof
What sort of program are you trying to write, though? This question sounds like you're trying to solve some problem that you aren't telling us about
0:34:06
asdf_asdf_asdf
OK. I want offset letter "a" for example 10px in right. In JavaScript i would write this: document.addEventListener('keydown', function () { myobj.style.left = pos+'px'; }, false);.
0:37:14
White_Flame
for terminal output, you can look at VT codes, ANSI codes, platform-specific cursor commands, a ncurses library, etc
0:37:32
White_Flame
all of it is basically sending out magic characters that the terminal interprets
0:38:28
White_Flame
but in most cases, you're plotting characters at the cursor, and moving the cursor. There is no active scene graph like what the browser supports in the DOM
0:39:20
Odin-
asdf_asdf_asdf: https://docs.microsoft.com/en-us/windows/console/ is the documentation for the Windows Console APIs.
0:40:55
p_l
Windows 10 in recent enough version (1803?) has new Console API designed for interaction with more termios-like programs
0:42:22
Odin-
For how much Unix is a horrifying accumulation of "it kinda works, go with it", Windows manages to outpace it on that front by a staggering amount.
0:42:23
White_Flame
looks like the API linked above does drill down into a notion of ScreenBuffers which hold a 2d array of chars & attributes that you can set, as opposed to just sending magic bytes via an I/O stream
0:43:16
p_l
White_Flame: because unlike serial terminal, you interact with what is essentially a text-oriented gui window
0:43:54
White_Flame
asdf_asdf_asdf: Lisp grew up as an all-encompassing environment. Connecting to platform specifics outside is a more intermediate/advanced topic that doesn't sound that appropriate yet
0:44:10
asdf_asdf_asdf
How connect my script with GUI empty window in Windows? This question, which I don't know probabaly.
0:44:17
Odin-
White_Flame: The magic bytes thing is really a byproduct of Unix treating just about _everything_ as a sequence of bytes with hardly any structure.
0:44:22
White_Flame
asdf_asdf_asdf: sort of like asking "How can the browser communicate with Windows API?" It would require plugins and whatnot
0:44:54
White_Flame
in the Lisp world, and most programmign languages, it's FFI (foreign function interface) which marshalls datatypes between languages and differing call semantics
0:46:45
White_Flame
but stuff is going to trend towards platform-independent systems, not hitting Win APIs or Linux syscalls or whatever directly
0:47:50
Odin-
White_Flame: Using the web and JavaScript as a GUI always reminds me of the NeWS design.
0:49:11
Odin-
p_l: It was actually designed _for_ that, rather than falling accidentally into it, so, yeah, obviously. :p
0:49:38
White_Flame
asdf_asdf_asdf: I haven't used any of those, but you might find something familiar in there. wxwidgets and gtk might be some of the more up to date toolkits
0:49:44
p_l
Odin-: and had good bidirectional communication path as well as options for memory mapping :)
0:50:21
Odin-
p_l: To continue a theme, for as much as Windows is a horrifying aggregation of historical mishaps and madness, the web is just ... yigh.
0:50:55
White_Flame
it's not that bad if you expect and up to date browser and ignore everything else
0:51:03
p_l
Odin-: windows... has a lot of that. And a lot more of "we need to support utterly idiotic programmers worldwide"
0:52:23
fiddlerwoaroof
You get to choose between GUIs jammed into a format designed for writing documents (e.g. web applications) or various piles of hacks that use OS apis
0:53:18
White_Flame
newer html/css has finally implemented actual GUI-style layout grids and other non-document-flow things
0:53:19
fiddlerwoaroof
And then all the nice systems (e.g. display postscript) have either died or need quite a bit of work to run natively anywhere besides linux
0:53:26
Odin-
fiddlerwoaroof: With the added horror that with all the GUI-related stuff they've been adding, it's hardly usable for documents anymore. 8)
0:53:34
p_l
White_Flame: in the code for that project I found random scripts downloaded from Geocities targeting Netscape 4 and IE4 ....
0:53:57
fiddlerwoaroof
Yeah, but CSS grid and flexbox follow the javascript maxim of "never standardize a feature without at least one major footgun"
0:54:20
p_l
Odin-: sometimes people get hit with stuff that is heavy on the W3C document-oriented standards... and it's "huh, you can publish things like that???"
0:55:45
fiddlerwoaroof
All this being said, CAPI is the least bad cross-platform gui library I've seen
0:55:51
Odin-
Is there a specific reason, or is it because the specs are so ridiculously intertwined?
0:56:31
fiddlerwoaroof
Odin-: well, the web component standards allow javascript to define the behavior of HTML elements
0:56:35
Odin-
HTML being specified in terms of DOM, which is basically specced in JavaScript, et cetera.
1:00:06
fiddlerwoaroof
It's just implemented in terms of the native os guis and it's easy to abstract over
1:01:11
jcowan
The Web is perfectly usable for documents. 90% of my interactions with it are with the document web.
1:01:26
Odin-
Something like the web model would be a good solution. You know, if it was properly designed for the role, with proper communications channels available right from the start. *cough*
1:02:56
p_l
White_Flame: the issue is that project like CAPI requires significant time investment to handle not just the 80% that one needs for current project
1:04:24
Odin-
jcowan: I was exaggerating for effect, although I'd also note that HTML doesn't seem to be anyone's choice of authoring format.
1:05:45
p_l
that is, CLIM is very interesting system but also totally alien to pretty much all systems (curiously enough it might look the least weird in classic X11 environment and among software from such era)
1:06:19
White_Flame
from what little I've heard of it, CLIM might be more akin to HTML than anything else
1:06:32
White_Flame
given that the objects it renders are more "live" from a programmign perspective
1:09:19
p_l
VSCode is an example of what can you do if the people you send to chisel in shit are masterclass
1:10:02
Odin-
p_l: I was surprised by how usable it seems to be as an editor, but holy crap is that thing insane in so many ways.
1:12:47
Odin-
And I know people who use Atom who ten years ago mentioned memory use as a reason not to use emacs.
1:14:27
p_l
Odin-: Atom is less egregious than Slack, but I'd still consider it part of EGACS class :)
1:26:09
White_Flame
I think that any new GUI system should also offer backends for VNC server and web-hosted
1:26:51
White_Flame
hmm, nah, VNC is kind of redundant, as something still needs to convert GUI elements ot pixels
1:27:27
fiddlerwoaroof
Oh, maybe Pharo Smalltalk's morphic system could be good if they stopped pretending to be a vm
1:28:31
White_Flame
yeah, I did a couple of fake desktop multi-window systems in my early programming, and it is Not A Good Idea™
1:30:31
fiddlerwoaroof
The little experiments I've done with mcclim are enough to convince me that it would be much nicer than emacs
1:33:06
White_Flame
ugh, reading the CAPI docs, they specifically declare coordinates are integers. That's not a good sign
1:35:23
White_Flame
yes you can, especially when dealing with rotated/transformed placements and vector drawing objects
1:39:50
fiddlerwoaroof
Are the coordinates specified to be pixels? I haven't really looked at the drawing apis
1:40:23
White_Flame
the more I think about GUIs, the more I just want to defer all the fiddly bits to HTML. It takes care of transforming anything, animating anything, antialiasing anything, and tries to make it fast.
1:43:50
fiddlerwoaroof
Sure, but at some point you're just standing on top of a teetering pile of junk
1:44:30
White_Flame
fiddlerwoaroof: it's not a stability issue, and it does pull off dynamic layout better than anything else in terms of flexibility and options
1:45:39
fiddlerwoaroof
It's not stability, strictly speaking, it's that you need 16GB of memory to run a modern web browser
1:46:19
White_Flame
with lots of tabs, yes, but that's the cost of having truly flexible, dynamic, fast (for what it does), and high quality layout/text/vector rendering
1:46:43
fiddlerwoaroof
Know, it's the cost of implementing things like privilege separation 5 or six times between the application and the cpu
1:48:21
fiddlerwoaroof
... I can't type: Chrome's memory usage is the cost of the nested runtimes that come between your web app (each of which looks however it wants to, with no regard for what the user wants it to look like) and the cpu
1:50:28
fiddlerwoaroof
Yeah, Apple didn't want to license display postscript, if I remember correctly
1:50:50
Odin-
Hm. I was under the impression it used the same drawing model, but dropped the Turing-completeness.
1:50:51
White_Flame
Odin-: I need to look into display postscript and how it dealt with dynamic changes. I have done a lot of postscript as a programming language and static 2d printing, however
1:51:10
p_l
fiddlerwoaroof: they found the cost too high back in the yellowbox era, then later they dropped yellowbox after having redone the graphics layer anyway
1:51:29
White_Flame
and regarding memory footprint, certainly using blink/gecko/etc should be lighter than the full browser
1:52:36
LdBeth
In the old days when the bandwidth was low they preferred to transmit drawing algorithms rather data structures to drawing clients
1:53:12
fiddlerwoaroof
White_Flame: maybe if you excluded javascript you could reduce the footprint, but spinning up a simple webkit app takes like 4G memory
1:53:18
Odin-
White_Flame: Yeah, but the rendering is entirely dependent on DOM, which is deeply linked with JS, so you can't really get it out of there.
1:54:05
fiddlerwoaroof
Yeah, but when I've experimented to just launch a simple web-view, the memory cost was still pretty high
1:54:33
fiddlerwoaroof
it's been a while, but I pygtk app that contains a webkit pane took 1-4G memory last I checked
1:57:37
White_Flame
that seems awfully whacked, given that my current FFs & chromiums that are open with lots of stuff are "only" taking a few GBs each
2:01:15
White_Flame
my running tor browser, which presumably keeps everything in RAM as to not leave traces between identities, is taking 588MB
2:44:41
jcowan
speculative question: what could be done that cannot be (beautifully) done now if dynamic variables were first-class?
2:54:09
aeth
jcowan: Do you mean what does CL do with dynamically scoped variables that couldn't otherwise be done in a nice way?
2:58:38
jcowan
No. I mean that if dynamically bindable objects were first-class rather than being attached permanently to indefinite-scope variables, what could be achieved with this relaxation?
3:00:28
LdBeth
What static scope do is simply make lisp behaves more close to call bye value lambda calculus
3:00:56
jcowan
Do you mean that you can't think of anything (neither can I) or that you can show that first-class status would not add either power or expressivity?
3:02:39
LdBeth
and building a more expressive call by name lambda calculus is possible with dynamics scoped lisp, i.e. INTERLISP
3:05:29
LdBeth
I think the main contribution is it enables to take advantages of some modern compiler techniques
3:11:43
jcowan
http://readevalprint.tumblr.com/post/145348323128/all-you-need-is-progv is interesting
3:13:47
jcowan
CLtL says "progv is particularly useful for writing interpreters for languages embedded in Lisp", but presumably this is only true if those language use dynamic binding.
3:18:59
White_Flame
I don't understand why compile is considered more valid than eval for runtime-generated sexprs
3:20:23
jcowan
https://codegolf.stackexchange.com/questions/53250/optimizing-ski-compiler is a compiler for SKI machine specifications; the CL version uses progv.
3:21:16
White_Flame
obviously, the article is using COMPILE's sexpr->executable facility as its primary feature, which is generally equivalent to EVAL in "wrongness"
3:25:05
LdBeth
<freenode_jco "claiming that `compile` evades t"> jcowan: you can use closure to avoid compile at run time
3:33:38
LdBeth
White_Flame: that’s like... you want to compile a file and of course one cannot avoid doing actual compilation
3:35:11
White_Flame
yeah, if you just mean CPS with your closure above, that's something I've done before
3:37:57
White_Flame
I mean trace through an AST for an expression, linking up pre-compiled lambdas together with CPS to yield a basic executable form of it
3:41:31
White_Flame
right, the above linked "eval is bad" to the same thing that compile does, in turning data into executables
3:41:56
White_Flame
then an idea of only using closures was presented, but doesn't do the same thing
3:44:41
LdBeth
Well it’s just happened to be calling a lisp compiler to compile sexps but the principle is the same as calling a C program translate SQL strings to a more compact form
3:47:18
White_Flame
depends on if the specific principle distinguishes between software interpreters and compilers :)
3:48:01
copec
It would be cool to have a distribution of typical results per language...like get the students to all implement one of the problems at the end of an algorithms course or something
4:05:23
elderK
I'm writing my own binary-structure kinda thing. Mostly for fun, but also because I found some deficiencies in other ones.
4:05:39
elderK
Anyway, you have some "binary type", which is like a primitive type that can be extracted or read.
4:06:34
elderK
Anywho, The "primitive type" could be anything, say, u128/be or whatever. I want to have a generic function that computes the "lisp type" of that primitive. So, if I had say, u32, I'd get (unsigned-byte 32)
4:07:45
elderK
It's not a header, though. It's just some primitive type that can be extracted. LIke an integer or float say.
4:12:12
LdBeth
Ah, you say it can be a string, so I thought it can have some other structure as type
4:12:45
elderK
You can define "binary structures" that will be parsed from disk, say. Like in PCL. Structures have slots that are other "binary structures" or say, "primitive types." These primitive types are things you define - like u32, u16, whatever. PCL does not generate any type information for the "slots." I will. So, given some "primitive type" (not a Lisp type), I need to generate a "Lisp Type."
4:13:51
elderK
What the mapping is, and how to read / write "primitive types" is set by a macro, define-binary-type, to use PCL's name.
4:15:20
elderK
Another question, is like, what's the deal with error reporting / validation from within macros? say, I want to ensure that someone uses the macros correctly.
4:19:55
pillton
The term, macro, is short for macro function. You can signal errors in macro functions if you like. It is probably best to do so.
4:21:55
LdBeth
About the other question, unfortunately you have to handwrite checking and error reporting, however it might be time to adopt @beach ‘s concrete-syntax-tree lib which has parser utilities for common macro constructions
4:55:52
aeth
Also destructuring-bind. That will catch a bunch of syntax errors that you can't express directly in the macro's lambda-list
4:56:29
aeth
something like this: (dolist (sublist list) (destructuring-bind (foo bar &key baz quux) sublist ...))
6:46:09
elderK
Hmm. I'm trying to unquote several levels. It's weird. Saying something like ,,something results in an expansion of ,whatever
6:59:52
fiddlerwoaroof
One trick that often helps is have your first level of quasiquotation call functions that do the actual parsing/construction of forms.
7:01:07
fiddlerwoaroof
e.g. here I've split the generation of the resulting expression across several functions and let bindings: https://github.com/fiddlerwoaroof/fwoar.lisputils/blob/master/fwoar.lisputils.lisp#L131
7:12:05
elderK
I don't think the way I'm trying this is really working out. I defined a generic function to like, handle the validation and expansion of certain "forms" in my ... macro
7:12:44
elderK
A method, expand-specifier would be executed, keyed on the :reader. It'd check the form was sane, then generate the appropriate expansion
7:38:54
fiddlerwoaroof
It works really well, but I've always been a bit concerned about the implications of this bit of the standard: "defmethod is not required to perform any compile-time side effects. In particular, the methods are not installed for invocation during compilation."
7:39:42
fiddlerwoaroof
I believe this essentially means that your defmethods need to be in a different compilation unit from the use sites of the generic function, if you want your code to be portable
8:01:37
no-defun-allowed
why does SBCL have `&rest args` in the lambda list for POSITION? it's not there in the clhs.
8:07:14
no-defun-allowed
my guess is it eats keywords it doesn't accept, it's present in some other functions too
8:12:43
jackdaniel
having '&rest args &key …' is useful, when you want to pass args further without extra consing
8:15:36
no-defun-allowed
now i realised using lambdas as arguments to a CLOS thing was a Bad Idea and multiple dispatch would have worked better
8:15:49
no-defun-allowed
or something like that. either way i'm wading through funcalls to fix it now :')
8:16:36
jackdaniel
you may want to look into filtered-functions (library written by Pascal Costanza)