Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Leah Neukirchen
    @leahneukirchen
    yes
    but so is '()
    François-René Rideau
    @farray:matrix.org
    [m]
    and so is #!void
    Leah Neukirchen
    @leahneukirchen
    only #f is false
    François-René Rideau
    @farray:matrix.org
    [m]
    If I were to design Lisp, I would have made it the opposite: only #t is true.
    Marc-André Bélanger
    @belmarca
    erm
    (if (compute-something) 'true 'false)?
    Drew Crampsie
    @drewc
    I remember when I first switched and became a schemer how the f/t messed me up as an empty list is true and many of my internal algos were based on nil aka () being untrue.
    Now I much prefer having them differentiated and when coding in CL rarely use NIL as false in the code. It may add an extra form or two but makes it very clear that lists are not boolean :)
    And agree with @belmarca. (if (ober-vector-truthiness v) ...)
    farray
    @farray:matrix.org
    [m]
    drewc: what is your CL false then? () ? '() ? NIL ? (and) ?
    (not not) ?
    Leah Neukirchen
    @leahneukirchen
    unpopular opinion among lispers, but ruby got this right. true, false, nil are all different and false and nil are falsy
    Drew Crampsie
    @drewc
    fare: I use the not not quite a bit. As I do in JavaScript or any lang that's lacking a proper bool as I think I need one :)
    Marc-André Bélanger
    @belmarca
    I don't understand the dislike for Scheme falsy?
    nat-418
    @nat-418
    Hello. What is the canonical way in Gerbil to access command-line arguments? I understand that (command-line) is left by R7RS to be implementation-variable, but depending on how I call a Gerbil script the number of elements describing the context varies. I am specifically looking to access the arguments, e.g., aand b in the example $ ./script a b.
    dlozeve
    @dlozeve:matrix.org
    [m]
    There's a module in the standard library for argument parsing: https://cons.io/reference/getopt.html
    It's very similar to e.g. argparse in Python
    nat-418
    @nat-418
    Thanks for the reference. So you define a toplevel procedure main that takes an args, and Gerbil will stuff the caller's arguments into a list called args?
    Jaime Fournier
    @ober
    yes
    (def (main . args)
      (if (null? args)
        (usage))
    dlozeve
    @dlozeve:matrix.org
    [m]
    You can find a complete example in the definition of gxpkg: https://github.com/vyzo/gerbil/blob/master/src/tools/gxpkg.ss
    pslh
    @pslh7_twitter
    what's everyone hacking on this weekend?
    Marc-André Bélanger
    @belmarca
    explicit-renaming macro expander
    François-René Rideau
    @farray:matrix.org
    [m]
    Learning how to configure guix
    Sofia
    @SwitchAxe

    hi everyone
    i was messing around with xml in gerbil, i managed to compile the stdlib with support for libxml2 and went to make a first script that imports the lib like this:

    (import :std/xml)

    but executing the script via gxi script_name.ss gives me this error, which i assume is the stdlib's fault:

    ERROR IN gx#core-expand-import%__% -- Syntax Error
    ERROR IN "/home/switchaxe/gerbil/lib/std/xml.ssi"@16.20
    --- Syntax Error: Cannot find library module
    ... form:   :std/xml/libxml

    (i removed special characters like asterisks to not fuck up gitter's markup engine)
    indeed, before i built the xml library with libxml2 support, that include worked, but including :std/xml/libxml didn't.
    and cat /home/switchaxe/gerbil/lib/std/xml.ssi yields https://nekobin.com/dalikijapi

    what's the issue? is it a bug? or is it my problem? is there a fix?

    Drew Crampsie
    @drewc
    @SwitchAxe From a brief glance it does not seem like the library modules are installed. Did you install after compilation? Did you set --prefix correctly? $GERBIL_HOME ?
    Sofia
    @SwitchAxe

    @drewc i followed the wiki, as it stated that if i don't need a nonstandard installation, i shouldn't need to manually install anything as the build script takes care of it?
    from https://cons.io/guide/#build-instructions
    "The ./install step is necessary if and only if you specify a --prefix option."
    i think it's worth to mention that before i rebuilt the standard library, the builtin (as in: without libxml2) library did import correctly (although it failed to find the parse-xml symbol which i just assumed was exclusively part of the libxml2 wrapper)
    and yes, $GERBIL_HOME is set correctly, as

    ~ λ echo $E:GERBIL_HOME
    /home/switchaxe/gerbil
    ~ λ

    shows (i don't use bash, i use elvish, but i can guarantee i set the env variable correctly, since i was also able to import stuff before i edited the stdlib features and rebuilt it)

    Jaime Fournier
    @ober
    @SwitchAxe what configure arguments did you use when you built it?
    Sofia
    @SwitchAxe
    none?
    i went with the standard ./build.sh installation when i installed Gerbil
    Jaime Fournier
    @ober
    --enable-libxml build std/xml libraries - requires libxml2 (default
    is NO)
    Sofia
    @SwitchAxe
    so changing the .ss file is not enough to actually build it?
    Jaime Fournier
    @ober
    I'd suggest using the configure script as it does the right thing.
    Sofia
    @SwitchAxe
    Drew Crampsie
    @drewc
    I'd suggest starting from scratch without any build artifacts and go from there. It may not be rebuilding what you desire as it has already been built and you have not changed the source files.
    Sofia
    @SwitchAxe
    is the --prefix option to configure mandatory even though i want gerbil to a standard path?
    Drew Crampsie
    @drewc
    @SwitchAxe Gerbil may not follow whatever standard you are assuming it does. Having said that, no. https://github.com/vyzo/gerbil/blob/master/configure#L603
    Having said that, I remember being new to programming many decades ago and one thing that certainly "help"'s is ./configure --help. Try asking the software itself! :)
    ./configure --help
    [...]
    Installation directories:
      --prefix=PREFIX         install architecture-independent files in PREFIX
                              [/usr/local]
      --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                              [PREFIX]
    
    By default, `make install' will install all the files in
    `/usr/local/bin', `/usr/local/lib' etc.  You can specify
    an installation prefix other than `/usr/local' using `--prefix',
    for instance `--prefix=$HOME'.
    [...]
    Drew Crampsie
    @drewc
    Now that I'm about to crack my first beer today I should mention that, IIRC, I wrote the ./configure; make; make install part in the beginning so if it does not work the way --help says let me know.
    Getting out of "trying to code after watching football for 11 hours instead of sleeping" mode into "have a beer to make sleep something that you'll not be able to do thinking of tomorrow being the second round of group stages that ends with the match you love to see when it happens" Vindaloo Vindaloo La la!
    pslh
    @pslh7_twitter
    Any goals in mind for gerbil for 2023?
    vyzo
    @vyzo
    happy hacking!
    Marc-André Bélanger
    @belmarca
    I would love to see seamless module integration with gambit 🙂
    Amirouche Amazigh BOUBEKKI
    @amirouche
    A) Is it possible to append directories to the load path of gxc ?
    1 reply
    B) Again with gxc, how can I specify the language?
    Drew Crampsie
    @drewc
    @amirouche:
    Gerbil v0.17-275-g7014e282 on Gambit v4.9.4-93-g176cff99
    > (apropos 'load-path)
    empty namespace:
      add-expander-load-path, add-library-load-path, add-load-path, cons-expander-load-path, cons-library-load-path, cons-load-path,
      expander-load-path, library-load-path, load-path, with-cons-expander-load-path, with-cons-library-load-path, with-cons-load-path
    > (load-path)
    ("/gnu/store/50zwwf6ns1rfbcdz9m3f77f2r2lp286q-gerbil-unstable-0.17-275-g7014e282/lib/gerbil/lib" "~/.gerbil/lib")
    ("/gnu/store/50zwwf6ns1rfbcdz9m3f77f2r2lp286q-gerbil-unstable-0.17-275-g7014e282/lib/gerbil/lib" "~/.gerbil/lib")
    > (add-load-path "~/foo")
    > (load-path)            
    ("/gnu/store/50zwwf6ns1rfbcdz9m3f77f2r2lp286q-gerbil-unstable-0.17-275-g7014e282/lib/gerbil/lib" "~/.gerbil/lib" "/home/drewc/foo")
    ("/gnu/store/50zwwf6ns1rfbcdz9m3f77f2r2lp286q-gerbil-unstable-0.17-275-g7014e282/lib/gerbil/lib" "~/.gerbil/lib" "/home/drewc/foo")