IRC channel logs

2021-08-03.log

back to list of logs

<jgart>Hi, does guile have something like (void): https://docs.racket-lang.org/reference/void.html
<dsmith>jgart: Is that what (if #f #f) would return?
<dsmith>jgart: That's the #<unspecified> value.
<chrislck>#unspecified and #nil: here be dragons
<chrislck>"abandon hope all ye who enter here"
<jgart>dsmith,
<jgart>#;5> (eq? (if #f #f) (void))
<jgart>#t
<jgart>it looks like it is
<jgart>I tested that it chicken but gambit has the void function also
<jgart>Should the fact that you can add a docstring to the following style of function definition be documented?
<jgart>(define hello (lambda (x) "docstring" (+ x x)))
<jgart>it breaks if I add the docstring immediately after the define keyword
<jgart>the metacommand ,d also works in the repl for it
<jgart>scheme@(guile-user)> ,d hello
<jgart>docstring
<jgart>In other words, should guilers know they can add docstrings to that style of define in the docs?
<jgart>If so, I don't mind adding it
<dsmith>jgart: It's hard to find but it's there: https://www.gnu.org/software/guile/manual/guile.html#index-procedure_002ddocumentation
<dsmith>"By convention, if a procedure contains more than one expression and the first expression is a string constant, that string is assumed to contain documentation for that procedure."
<jgart>It seems like some keywords explicitly document the docstring and some don't
<jgart>so it feels a bit inconsistent in the docs
<jgart>for example: Syntax: define-syntax-rule (keyword . pattern) [docstring] template
<jgart>from this page: https://www.gnu.org/software/guile/manual/html_node/Syntax-Rules.html
<jgart>It's explicit about define-syntax-rule supporting a [docstring]
<dsmith>Ya, the manual is inconsistent. The docs for case-lambda show a docstring in the examples, but not in the text.
<jgart>Ok, I'll keep that in mind
<jgart>maybe I'll send a patch at some point with some fixes for that
<jgart>It seems like there is also a lot of functions that could benefit from a docstring
<jgart>so that we can have the convenience of accessing them from the ,d metacommand
<jgart>instead of just returning #f because they don't have any docstring
<jgart>for example see the difference here between janet and guile doc for first:
<jgart> https://paste.sr.ht/~guixtogether/c83d532a255c4d31465f7ca632648ddc00c3e325
<jgart>that's maybe a trivial example as people can guess what first does but it is still nice to get something back in the repl without having to search through docs. This is especially useful for beginners of guile and/or scheme.
<jgart>that's maybe a trivial example as people can guess what first does but it is still nice to get something back in the repl without having to search through docs. This is especially useful for beginners of guile and/or scheme. Given that the metacommand ,d exists I think we should use it fully for getting all documentation. Would it be ok if I add docstrings for functions that are missing them?
<jgart>I can send patches for that for review
<daviid>lloda: maybe you can help - i'd like to define a null terminated array (vector) of 'what-ever, say unsinged-long to start with ... from scheme, for the g-golf test-suite, how do i do that?
<mfiano>Hi
<mfiano>Perhaps a dumb question, but why do Linux distributions, even those that live on the bleeding edge, only have Guile 2.x in their repositories?
***V__ is now known as V
<daviid>lloda: i answered my own quiz, tx
<jgart>mfiano, not enough interest to rush to package it
<leoprikler>jgart I would welcome it if we could generate such documentation uniformly with texinfo
<leoprikler>our current texinfo game is somewhat weak
<jgart>leoprikler, Wouldn't it just be a matter of adding a docstring just like other functions that currently have a docstring?
<leoprikler>Not quite.
<jgart>Or, do you mean that the texinfo curently does not parse the docstrings in the code?
<leoprikler>If you e.g. have texinfo in a docstring, that docstring will yield texinfo code and not attempt to render it
<jgart>I mean the doc system
<leoprikler>not very human-friendly
<leoprikler>if you have texinfo in a doc comment (the kind of comment that can be snarfed via doc-snarf) it won't show up as docstring
<jgart>leoprikler, is there any documentation on doc-snarf?
<jgart>scripts/doc-snarf.scm?
<leoprikler>"guild help"
<jgart>cool! hadn't used guild yet
<jgart> https://paste.sr.ht/~guixtogether/2edf3e00248c4df2f2224dfe172625851724d19a
<civodul>jgart: hey, where does "graph-easy" come from? looks cute!
<leoprikler>apparently cpan?
<civodul>ah, we need a package then :-)
<lloda>texinfo now does svg math in html output. It's pretty great, I wanted the feature for years
<jgart>civodul, yes it's a perl package
<jgart>lorem is cute too
<jgart>I'll try to work on those two soon if nobody else gets to it first ;)
<jgart> https://metacpan.org/dist/Text-Lorem/view/bin/lorem
<mfiano>is there anything like asdf for guile?
<leoprikler>(guix build-system guile) :P
<leoprikler>There is hall, which generates guix and automake packages, but imo it's more fun to just write plain automake if your project is complex enough
<mfiano>hall hasn't worked in months
<mfiano>syntax error attempting to invoke it
<leoprikler>Okay, there was hall :P
<mfiano>things look barren coming from CL :)
<leoprikler>Well, you'll eventually come to see that things are not barren but chaotic.
<leoprikler>CL is a language with many implementations (as is C/C++), but a common structure across them, which makes everything seem samey and neat.
<leoprikler>Scheme OTOH is a wild land where every implementation does as it pleases.
<mfiano>I decided on Guile as it seems batteries-included enough, and has GOOPS etc
<mfiano>Just read the entire language reference in one sitting. It was rough
<leoprikler>yup, GOOPS is inspired by CLOS, but I don't think it has all the features
<mfiano>I'm still unsure on best project management practices. how to define packages and manage file load order, etc
<mfiano>I guess i dont know how to start other than just writing code in a scratch file :p
<leoprikler>I think there are some books out there with practical project examples, not that I give a damn about those usually.
<mfiano>oh?
<leoprikler>[in general Scheme, not particularly guile]
<leoprikler>also note that R6RS onwards has a library system, though Guilers prefer define-module
<mfiano>whatever gets me up and running would be appreciated
<mfiano>now that i read how to use the language
<leoprikler>Reading a language reference once is not enough to understand it :P
<leoprikler>It's rather a place to grep in when you're asking yourself "how do I X" or "what does car do tho?"
<mfiano>the language reference doesn't really talk much about dependency management, file load order, downloading libraries, discovering libraries, publishing libraries, and all the other things that make a programming language useful for collaborative coding.
<leoprikler>discovering and publishing libraries is stuff for package managers
<mfiano>like, not sure where to begin to create a "project" that knows how to load itself such that macros are defined before use, etc
<leoprikler>you can do that with Guix for example
<leoprikler>for dependency management, guile has autoconf macros that you can use to check whether a given module is defined
<leoprikler>E.g.: https://gitlab.com/leoprikler/tsukundere/-/blob/0.3.x/configure.ac#L42
<leoprikler>I don't really understand the term file load order or how it becomes a problem, but typically it's (public-module) vs. (public-module very hidden "private" stuffy)
<leoprikler>for the module names
<mfiano>Fair enough
<mfiano>Guess I'll have to learn autoconf/make or guix in addition to Nix :)
<mfiano>But bed time now. see ya
<dsmith-work>UGT Greetings, Guilers
<rlb>civodul: if we think fash (at least -- suppose there's also fector) is suitable, then I'd be more than happy to have it in guile itself (definitely like for guile to have a good built-in persistent vector/map/set), and would also be happy to help with the process of including it.
<rlb>No idea what they should be named ...(ice-9 persistent)...
<rlb>And presumably we'd still need some reasonable function prefix foo-set, foo-fold, etc. given the normal scheme convention there.
<lloda>i miss an extension mechanism for constant-type in (language cps). I have a reader for a new type but I don't see a way to have literals work in the REPL :-|
<lloda>ideas welcome
<rlb>mfiano: if it helps https://packages.debian.org/search?keywords=guile-3.0 and bullseye should be released as "stable" soonish.
<rlb>mfiano: and wrt getting started, if you were just asking about setting up something simple for now, a minimal arrangement is perhaps a directory with a subdirectory, say "module" or "mod" containing your guile module tree, i.e. mod/my/somemodule.scm, and then in somemodule.scm you'd have a (define-module (some module) ...)., and you'd run things from the top level via 'GUILE_LOAD_PATH=$(pwd)/mod guile "$@"' (or a similar wrapper
<rlb>script). I mean if you just wanted to understand the basic mechanism. (Could also use "guile -L mod ...".)
<rlb>At that point, (use-modules (my somemodule)) should work, and handle dependencies (between your modules, and any built-in guile modules), etc.
<rlb>bbl
<cwebber>hello hello!
<cwebber>I'm porting Spritely's Goblins library to guile today, how are you all
<liltechdude>Hello gyus. How I can bound built-in webserver with varibale (define my-server (server 'http)) and run in foreground with something like (server-start my-server)/stop with (server-stop my-server)?
<hendursaga>cwebber: sounds cool, is it public yet? no pressure, just wanted a link to check it out later
<drakonis>oh, nice.
<daviid>clone: I had to fix another problem, not a bug but something to adapt to someanotation changes in gtk 4.3.1 that 'broke' the clipboard example, and shall push that work later today, then back to solve vijaymarupudi's bug report wrt get-cursor, and yours 'simulatenously'... mean while, it would be nice if you could work on an example to reproduce, that i could run here .. doesn't need to be 'that small' ...
<vijaymarupudi>daviid: oh yeah I was going to report that today, glad you found it!
<daviid>vijaymarupudi: didn't find the solution yet, i will start to work on it latertoday ...
***emacsoma1 is now known as emacsomancer
<cwebber>hi hendursaga, haven't pushed it up, but let's see if I can by the end of the day, still self conscious over its current state :)
<cwebber>but things are starting to work
<clone>daviid: https://paste.gnome.org/pxg6m827k
<drakonis>hoho, that looks like a fun trick
<clone>it should throw an invalid iter error pretty quickly, or run forever once you've fixed it. Thanks for looking
<drakonis>goblins in guile.
<drakonis>neat.
<daviid>clone: ok tx! - note that you may activate 'scheme' when you paste using gnome or debian, which 'renders' the code ... (don't repaste this one of course, just mentioning for future pastes ...)
***jackhill is now known as KM4MBG
***bjoli is now known as manumanumanu
<mfiano>rlb: Thank you
<mfiano>I have another question that the documentation didn't answer for me
<mfiano>In Scheme, is it always a 1:1 mapping between modules and files? In CL, "module"s can extend to many files, or many modules can be in a single file.