<chrislck>it's a strange state of affairs when C is slower than guile <ryanprior>Y'all how do I accomplish a negative lookahead in Guile regex? I want a pattern that matches any string not ending in ".v" <ryanprior>I tried ".*(?<!\\.v)" and it does not like that <ryanprior>I actually tried it with two backslashes, and typed it into IRC that way, but I see it with a single backslash. So if you see only one, know that I typed two and that at least is not the problem. <ryanprior>I want to list all files in a directory that don't end in ".v" - maybe there's an easier way than using regex to match the names, I'm open to anything :) <ryanprior>Okay so I think I can use a file-system-fold using string-suffix? on the file names. ***karlosz_ is now known as karlosz
<ryanprior>Dang okay, that raises many questions. Is there much performance overhead in Guile for exception handling? In some dynamic languages it's quite resource-intensive because it captures all the information about the stack and turns it into a data structure etc <spk121>of course, I should have used string-suffix, but, I couldn't remember the name of it <ryanprior>Also is it expensive in Guile to reverse a very long string? Does it eagerly perform the O(n) computation or does it give you a lazy reverse iterator? <spk121>string-reversal is probably not the way to go. I was just being lazy. string-suffix would be better <ryanprior>Like I know in Ruby, filename.reverse.start_with? "v." would be constant-time <ryanprior>I just like learning & knowing these internal things =D <chrislck_>ryanprior: you'd do well to clone guile source code - it's very readable <ryanprior>Ah okay so it does eagerly reverse the string <ryanprior>One of the things that's made it hard for me to learn Guile is that a lot of crucial stuff is inside these SRFIs and I'm not good at figuring out which ones are relevant to what I want to learn <ryanprior>I get the sense that a lot of Guile hackers must have a bunch of these SFRI numbers and ice-9 modules memorized <ryanprior>I need to find (or build) a resource for Guile that's similar to clojuredocs.org & friends <ryanprior>I've been using the Guile info manual and it's time consuming and often frustrating to try and search the manual to find functions I want <ryanprior>And even when you do find the function you want, it doesn't have hyperlinks to the actual C source code so you have to go and hunt down where it's defined ***sneek_ is now known as sneek
<ryanprior>I do use ripgrep, but if I search for something then I wade through the results to find the actual definition I want. <ryanprior>Versus the docs for other languages I use, where finding that info takes seconds. <ryanprior>It makes all the difference between staying in the flow and accomplishing tasks as I learn the language, or bogging down and using my mental resources navigating code instead of focusing on the problem at hand. <Aurora_v_kosmose>Is Geiser not able to find a definition for a function typed in its REPL? <chrislck_>ripgrep in emacs makes it easy to jump to definition <Aurora_v_kosmose>ripgrep requires you to pattern '(define (whatever-this-is-aname' rather than just M-. <chrislck_>All I did was 'M-x rg' 'string-reverse' [ENTER] [ENTER], get results, C-x o, [down] to results, [ENTER] <Aurora_v_kosmose>In some cases of a popular function, you might get hundreds of matches with just that name. <Aurora_v_kosmose>Though I suppose Guix is perhaps not the most typical of Guile projects in scope... <leoprikler>ryanprior: If you think hard about it, memorizing SRFIs is not too different from memorizing std:: namespaces and their headers <ArneBab>Aurora_v_kosmose: you could try dumb-jump which can use ripgrep as backend <ArneBab>Aurora_v_kosmose: you might have to define the target source, though <ArneBab>ryanprior: for ice-9 I do not have numbers memorized — that’s just the prefix to the guile-specific stuff. For SRFI’s I agree: For me it also took long to learn the relevant ones and I still have to go searching to see which one is relevant. <ArneBab>Something like srfi-lookup which interactively narrows down to SRFIs would be pretty useful — also between implementations. <ArneBab>I use it for javascript development at work — it’s just as good as IntelliJ in finding definitions in Javascript-code :-) <ArneBab>(which means it is not too shabby but not perfect — but fast enough for a large codebase) ***apteryx is now known as Guest33950
***apteryx_ is now known as apteryx
***chrislck_ is now known as chrislck
<justin_smith>if there's one thing a programmer loves, it's being the nth+1 person to make the same joke <ane>is there a way to force some guile code enter the debugger we see in the repl? <leoprikler>ane: what exactly do you mean by that? You can trigger the debugger by throwing an exception etc. but what are you trying to accomplish? <ane>well, something like (break) <ane>instead of having to call some code that's guaranteed to go boom <rlb>Imagine this might be intentional, but when trying to write some syntaxes that introduced some recursive bindings, noticed that #nil has no syntax, i.e. (syntax 5) is fine but (syntax #nil) crashes. Is that intentional? <rlb>This complicates things when (for example) trying to get the first form from a "body" to use via say (datum->syntax (car body) 'foo). i.e. that works unless the body was (#nil ...). <leoprikler>ane: No direct solution, but have a look at (system vm traps) <leoprikler>rlb: depending on what you work with, that might very well be. <leoprikler>I suppose #nil is undefined outside of the Emacs bindings. <rlb>Wonder if it'd be reasonable for it to behave like "everything else" there... <leoprikler>would "#(1 2 3)" be acceptable in that position? <leoprikler>I think you might be able to add #nil as a special case in the usally empty arglist after syntax-{case,rules} <rlb>I just meant that if (syntax #f) is valid, then perhaps (syntax #nil could be too). <rlb>For what it's worth, the broader context was trying to figure out how to introduce an unhygenic binding for say 'foo to an arbitrary "exp ..." matched set of "body" expressions. <rlb>i.e. foo should be in scope for those forms, and nothing else. <rlb>(and just randomly, this was in a context where #nil might appear, so I noticed, when #nil ended up being the thing pulled out of the body for the (datum->syntax ... 'foo) call. <rlb>yes, i.e. "break" for a loop, or... <RhodiumToad>was there a good reason for the unhygenic binding, rather than a hygenic one or a syntax parameter? <leoprikler>In my personal experience, getting such macros to properly expand in the first place is not a trivial task. <rlb>leoprikler: the problem was that given that "exp ..." body I was trying to use something from that body as the context/template argument for datum->syntax in order to establish the 'foo with the right scope. That works fine if you grab a symbol, etc. but nil crashes datum->syntax because it's not (and can't be) a syntax. <rlb>But I suspect my approach may not be entirely sound to begin with. <rlb>I guess the fundamental question I had is, given an "arbitrary" syntax object, can I introduce a binding that's visible to everything in the object (i.e. wrap it in a let(rec) for that unhygenic binding, and if so, how -- i.e. where do I get a suitable context for datum->syntax. <rlb>It's a much weaker form of our "let loop" <rlb>and one where the only name available is 'recur <rlb>(loop [n 0] (while (pos? n) (recur (dec n))))