IRC channel logs

2019-12-29.log

back to list of logs

<mwette>tk is an interesting idea ...
<RhodiumToad>every time I use some other gui I get frustrated by how hard it is to do things that are trivial in tk
<RhodiumToad>but the downside of tk is that you have to use tcl#
<spk121>Tk is the most popular Python GUI toolkit, via the Tkinter library.
<spk121>In the world of programs that don't need to exist, I'm almost done writing the 'ed' line editor in Guile
<mwette>spk121: awesome, I actually use ed a lot in scripts: a fine scalpel compared to sed and awk
<jcowan>spk121: Awesome! As a heavy user of "ex", I love it.
<jcowan>(I know "ed" is the standard editor, but I am willing to trade a little standardosity for a little convenience)
***catonano_ is now known as catonano
<d4ryus>hi, when i have some kind of container (hash-map/alist/...) which contains a symbol, how can i loopup the value of that symbol? (eg (begin (define x 3) (hash-set! some-table "/" 'x)) how to retrieve the value of x given only some-table and the key "/")? eval would work, but i guess there some other way?
<zig>scheme@(guile-user)> (define x 42)
<zig>scheme@(guile-user)> (eval 'x (interaction-environment))
<zig>$1 = 42
<zig>d4ryus: ^
<spk121>d4ryus: it may be that what you really want is a box. Check 'make-variable', 'variable-ref', 'variable-set!'
<pkill9>is it possible to get the resulting code of a function as data? For example, if I made a function `(define (something a) (display a))`, would it be possible to get a result of '(display "test") from doing something with (something "test")?
<pkill9>i know i could define the function as data and then evaluate it, but i'm wondering if it's possible to do it the other way round, define it as a normal function and get the code as data
<d4ryus>zig, spk121: thank you, box will do what i want :)
<zig>pkill9: there is `procedure-source` but it does not always work. A workaround could be to parse the file where the given procedure is defined.
<pkill9>i'm gonna have the function provide an "evaluate?" keyword and just evaluat eit by default
<pkill9>hmm eval is a bit meh, since it's not quite the same as a regular function
<pkill9>e.g. running it in the repl, it doesn't see the modules that were imported from the module it's from
<mwette>pkill9: not sure about your use case, but maybe you could define a macro to define your function and add a property that provides the body in some other way
<janneke>mwette: rel-1.00 fixes #if FOO problem; running a full mes build to check the rest
<mwette>janneke: good to hear -- sorry about the error, was hoping 1.00.0 would be solid
<mwette>I even had a failed test, but that didn't stop the make, so I need to check that out.
<janneke>mwette: yeah, i was sorry too; you took such good care doing all the 0.9x stuff and all
<janneke>i guess thats how things go :)
<janneke>mwette: another thing, nyacc comes with pre-generated files for the c99, right?
<mwette>yup. Also, ran into problems compiling on (my) ubuntu because it has guile-2.2 in /usr/bin but no guild-2.2 (only guild). And someone else was trying to build for 3.0 using 2.9.7 but that was running into configure issues also; I think it's all working now; we are testing
<mwette>janneke: yes, the tables are generated for each release, I run "make dist-files" prior to release
<janneke>mwette: i haven't looked into that, we might have a bootstrap problem there?
*janneke hopes this is a red herring
<mwette>janneke: depends on how you define bootstrap; the needed files are part of the distribution, and they are Scheme source code, nothing machine dependent
<janneke>well, generally we d not consider generated files to be source code
<janneke>*we do
<mwette>the files are also included in the repository
<janneke>true...but generated source can be just as opaque as a binary
<mwette>look at the "dist-files" entry in nyacc-0.00.0/modules/Makefile.in
<janneke>is nyacc needed to create those files, or just guile?
<janneke>i should have a look if they can be produces with mes
***ng0_ is now known as ng0
<janneke>it's not urgent, but we do want to have a clean bootstrap path, some day
<mwette>you'll need to run gen-cpp-files and gen-c99-files
<janneke>ok
<mwette>not gen-c99cx-files, I assume
<janneke>mwette: meanwhile, mes builds with rel-1.00
<mwette>janneke: good -- thanks for checking
<janneke>yw
<mwette>different versions of guile could presumably generate different c99 table files
<janneke>mwette: well, this is going to be interesting; running cppmach.scm depends on psyntax, which is in itself a bootstrap cycle that we haven't cut yet
<janneke>i sort of managed to generate cpp-act.scm.new; but cpp-tab.scm.new needs letrec*, which mes does not support yet
*janneke just recently learned that letrec* ought to be in mes C core; we'll see :-)
<janneke>i'll first have a stab at letrec* using define-macro -- odd that it's not in psyntax.ss; prolly too old?
<mwette>do you have letrec?
<mwette>I may be able to replace with let*; it appears in nyacc/lang/util.scm
<mwette>totally looks like the one use of letrec* could be replaced with let*
<janneke>mwette: oh, that's great; yes, i have letrec and let*
<jcowan>letrec* dates only to R6RS or a little before
<janneke>jcowan: ah, i am using a pre-r5rs syntax case, with some extensions
<janneke>mwette: it seems that one letrec* can be changed to let*, the other to letrec
<matijja>Hello #guile!
<matijja>Why when I run command "guild update" it throws me error "Unbound variable: =>"?
<zig>what are you trying to achieve?
<mwette>janneke: found them (nyacc/util.scm and nyacc/lang/util.scm); I have changed them for future 1.00.1
<janneke>mwette: thanks!
<janneke>i just got mes to run gen-cpp-mach!
<mwette>sweet ; that should exercise a lot
<janneke>hmm, yes -- however gen-mach bombs out inside my psyntax ; oh well, later!
*mwette has released nyacc 1.00.1