IRC channel logs


back to list of logs

***catonano_ is now known as catonano
***terpri_ is now known as terpri
<rilez>is anyone working on a clojure-on-guile?
<str1ngs>Hello daviid. I have a good idea what's happening with setenv. Seems short method names produces setenv when GIO is used. Example g_app_launch_context_setenv. You can test this from a REPL with (gi-import "Gio") and (describe setenv). That should cover the setenv #<<method> (<g-subprocess-launcher> <top> <top> <top>) generic method. But I'm not sure what's used for Method #<<method> <top> 557569863b80> maybe g_setenv? It's not that
<str1ngs>important since I can add setenv to %gi-method-short-names-skip. At least with guile 2.2.7 that clears things up. with guile 3.0 I have not tested yet. Though I think the other guile 3.0 issue we discussed just brought this my attention. I don't import Gio directly it's a typelib dependency somewhere.
<rilez>more importantly, is there a library for generic collection access + algorithms?
<leoprikler>rilez: I don't think Guile has generics in the same way other languages do. Procedures are very specific w.r.t. the types they operate on
<leoprikler>It also rarely makes sense to use an implementation that assumes e.g. lists for doing stuff with vectors or arrays.
<bitwiz>mauritslamers: great :)
<catonano>leoprikler: I remember reading a hint about the expectation that a thng being called is always a lambda on Andy Wiongo's blog. In discussing the idea from Clojure that you can call a collection thing as if it was a lambda. Or something.
<RhodiumToad>you can create callable things in guile that are not lambdas
<catonano>leoprikler: as for lists being the thing in lispy languages, I heard a claim about that by Rich Hickey. Also Sussman remarked that the idea of having abstract types and lists being only one possible reification was a good idea by the Clojure folks
<catonano>RhodiumToad: can you ? How ?
<RhodiumToad>easiest way is to make a goops class derived from <applicable-struct> or <applicable-struct-with-setter>
<catonano>ah right. I tend to overlook goops
<RhodiumToad>you can make applicable structs outside of goops too
<catonano>really ? How ?
<RhodiumToad>I've not tried
<RhodiumToad>but I know it's possible, not least because goops can do it
<catonano>interesting. I'd be curious to know how 🤔️
<RhodiumToad>I don't know if any of the record APIs allow it.
<RhodiumToad>examples of how its done can be found in the guile core modules
<RhodiumToad>for example, parameters are applicable structs
<RhodiumToad>that's probably the simplest example, actually
<RhodiumToad>see boot-9.scm on the page starting ";;; {Parameters}"
<catonano>RhodiumToad: note taken
<RhodiumToad>this is one way to do it with goops:
<RhodiumToad>with that code, an object of class <my-map> can be called as (obj key) to look up keys, or (set! (obj key) val) to modify
<catonano>RhodiumToad: thanks ! I saved it locally as a reference !
<RhodiumToad>it's also possible to make a base class which forwards the apply and setter operations to specific method names, and then you can just derive from that
<RhodiumToad>(you need something like that if you want to make an applicable object which is derived from a non-applicable one, for example)
<catonano>I see
<catonano>RhodiumToad: it would be nice if you would contribute an example showing this to the collection of Guile code examples that has been discussed recently on the mailing list
<peanutbutterandc>Hey there
***terpri__ is now known as terpri
***terpri__ is now known as terpri
***sneek_ is now known as sneek