<linas>So running ChanServ on this channel is intentional? Because when I try to msg chanserv, all the responses come back here, mo matter where I started... <linas>and a few exclamation marks of approval drama!! <RhodiumToad>chanserv is here because (for whatever reason) the GUARD option is set on the channel <linas>OK, thanks! the drama of onboarding... ***micro is now known as micro_
***micro_ is now known as _micro
***_micro is now known as rprimus
***rprimus is now known as rprimus_
***rprimus_ is now known as _rprimus
***_rprimus is now known as golgotha
***golgotha is now known as micro
***rekado_ is now known as rekado
<leoprikler>Is it difficult to generate Theme D bindings from scheme or is it rather straightforward? <tohoyn>leoprikler: you mean accessing guile procedures from Theme-D code? <tohoyn>leoprikler: here is the definitioj of Theme-D procedure d-car that is implemented by guile procedure car: (define d-car (unchecked-prim-proc d-car (<object>) <object> pure)) <tohoyn>leoprikler: the first <object> is the argument type <tohoyn>leoprikler: the second <object> is the result type <leoprikler>and pure vs. nonpure is whether they change state <tohoyn>leoprikler: "pure" means that the procedure has no side effects <tohoyn>leoprikler: here is an example: (define string <tohoyn> (unchecked-prim-proc string ((rest <character>)) <string> pure)) <tohoyn>leoprikler: procedure string takes an arbitrary number of characters as arguments <tohoyn>leoprikler: "unchecked" means that Theme-D compiler/linker does not generate code to check that the result value is of correct type. <leoprikler>can it do (and (* (<keyword> <object>)) <string> (rest <object>))? <leoprikler>or do I just have to write (rest <object>) and let it be caught at runtime? <tohoyn>leoprikler: what are you trying to define? <tohoyn>what are the argument types and the desired result type of this procedure? <leoprikler>the procedure gets an <entity> and returns a procedure <tohoyn>leoprikler: you can define procedure types in Theme-D <tohoyn>leoprikler: procedure map1 applies the argument procedure to the argument list <tohoyn>leoprikler: what are the argument and result types of the returned procedure? are they arbitrary? <leoprikler>it's a keyword-value list followed by optional string + rest (rest is just a bool atm, but not important) <tohoyn>leoprikler: (declare myproc (:procedure (<entity>) (:procedure ((rest <object>)) <object> nonpure))) <tohoyn>leoprikler: it's ok if you pass the keyword-value list as one argument <tohoyn>leoprikler: I'm afraid that can't be done <leoprikler>okay, so I'll still have the work inside the match-lambda <leoprikler>what's the difference between declare and (define d-car ...) btw? <leoprikler>could I "use-modules" a guile module and then just put a bunch of declares and be done with it? <tohoyn>declare declares a procedure and it is used mostly in interface files (each module has an interface and body) <tohoyn>leoprikler: you have to tell the Theme-D linker to generate code to include your guile module in the Theme-D program <tohoyn>leoprikler: then you have to put the declare's into the interface file and the correspoding define's into the body file <leoprikler>speaking about linker, what does theme-d compile to? <tohoyn>leoprikler: guile Scheme or Tree-IL <leoprikler>is it theoretically possible to write a theme-d header for a scheme body? <tohoyn>leoprikler: no, you have to define the procedures as "prim-proc" or "unchecked-prim-proc" <tohoyn>leoprikler: but it would be quite easy to write a program to generate the body <tohoyn>leoprikler: actually Theme-D-Golf resembles that <tohoyn>leoprikler: the interface and body files are generated from a "Golf import" file <tohoyn>leoprikler: then Theme-D-Golf has a third script that generated a guile module to be included (use-modules) in the target program <apteryx>how do I return all the matches for a given regexp pattern in a string? <civodul>apteryx: there's a fold-matches procedure <apteryx>Would someone be able to tell why the following service fails with: Unbound variable: pattern ? Perhaps the and-let* syntax is somehow not made available? Otherwise I fail to see it. https://paste.debian.net/1199223/ <RhodiumToad>apteryx: I don't see anything that imports and-let* ? <apteryx>oh! I thought I added that... but it's indeed missing. Let me regenerate that (it's created by a Guix G-Expression) to make sure. Thanks! <apteryx>ah! I see my mistake; I added (srfi srfi-2) to the wrong service. eh. Sorry and thanks again for lending me your eyes :-) <civodul>apteryx: i suggest avoiding srfi-2 in Guix :-) <civodul>RhodiumToad: like i said, it's a matter of state; i find i'm usually better off with 'match' and sometimes 'and=>' <leoprikler>match and and=> work super if you have a common source, but are somewhat clunky if you're dealing with inputs coming from multiple places <leoprikler>though in the specific case of Guix, that ought to be rare <RhodiumToad>I've used it in cases that basically amount to: compute a value, check its range, compute a further value from it, check that <apteryx>right, that makes sense to me, but perhaps it's more procedural in style than functional <lispmacs[work]>hi, I am wanting to write a guile program to interact (RX and TX) with some firmware I have running on an Arduino board, through a ttyACM connection (UART over USB). i.e., to do stuff you would normally have to type into minicom. I was wondering if Guile has some kind of support for serial communications, or if I try piping things in and out of the modem program, or if there some better approach... <RhodiumToad>bidirectional piping to a subprocess is very difficult to do cleanly without deadlocking <RhodiumToad>it should be possible to handle the serial port directly from guile without too much difficulty <lispmacs[work]>RhodiumToad: how do I handle the baud rate settings and such from Guile? <RhodiumToad>hm, tcgetpgrp etc. are present, but not tcgetattr/tcsetattr <dsmith-work>For serial stuff in general (but it seems to be mostly usb serial these days), I like to use ser2net. Yeah, you must edit a config file. <dsmith-work>I usuallly have different ports for different baud rates. <dsmith-work>As a bonus (or sercurity hole) I can than get to get serial port from anywhere in the network. <dsmith-work>I used that almost daily to talk to linux serial consoles or other embedded devices with a uart.