From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Zelphir Kaltstahl Newsgroups: gmane.lisp.guile.user Subject: Re: Long command line arguments using SRFI 37 Date: Mon, 7 Jan 2019 15:08:06 +0100 Message-ID: <281bb613-8444-59f7-0956-c449ccc58804@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1546869997 25459 195.159.176.226 (7 Jan 2019 14:06:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 7 Jan 2019 14:06:37 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 Cc: Guile User To: Catonano Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jan 07 15:06:33 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ggVY0-0006UH-3C for guile-user@m.gmane.org; Mon, 07 Jan 2019 15:06:32 +0100 Original-Received: from localhost ([127.0.0.1]:59973 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggVa7-0002iQ-3N for guile-user@m.gmane.org; Mon, 07 Jan 2019 09:08:43 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:53842) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggVZd-0002gE-RP for guile-user@gnu.org; Mon, 07 Jan 2019 09:08:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggVZc-000057-81 for guile-user@gnu.org; Mon, 07 Jan 2019 09:08:13 -0500 Original-Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]:45885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggVZb-0008WA-SV for guile-user@gnu.org; Mon, 07 Jan 2019 09:08:12 -0500 Original-Received: by mail-lj1-x236.google.com with SMTP id s5-v6so392823ljd.12 for ; Mon, 07 Jan 2019 06:08:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=dr0gYUbecTOhehKaG322zErX2B8kRYyW7lsGomHTpiQ=; b=PPdm6GtZ9MSAdrIPLCiUxkGEEytHW+Spp2Kfa7QgjRwnBnpBEN/lHigrY0zp8OyjNh gZxm/JbMSQ6cba3h97g0YZNeYSajB9LQwS1lABVyF4g0rIpxGg1AvDlEa3jCSKzbu7QC 0IWpGNGgLGgfRSKTWzCEf6OutVflMIo69rECYNVdwKTDKxKPsDvitpJkojVMsWvIKj5g dzGDoLHTYl1CVL/9tf8pLBDG0tWMZes5GgenNW2soy6EXJAVRmv4LLfj4+kEd05Hzwmh dzrkRLNlfF4earu7ncX0E806mZcTWsHuzw4eTBt2qNal18kC031pVnG4OJad7UnLwh7C Oz9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=dr0gYUbecTOhehKaG322zErX2B8kRYyW7lsGomHTpiQ=; b=lVV7f1FLSoeOeRv3Np5xn4Vi26vvc2XTeKBon9PY11kwCVPqpFqG56BXnpOCNCpjSn bbyGyG7i/btOPEz16dADVp+WH1GE6FaLYNqUas63KdkMCYnqnnkF+z+2JtyjFgyDIrb1 sD609Ch0ST47RCPTMCgyjfHy4Se0xOdWL1jAUj9xnxo+Q4YQMnuFGw7cWQjA/ZOunLUY thgshlWhqMOqhKEuETrvEojs5n3/+odf7lnHf0Na2hhhsrqI59j1AiMPo+fx/B6fQuNH iDceWLOYY8yKHj5ebFb3UTDkoTVgjd0ZHCZxzasV/ap47whKzm2YlivDBjiiiNFFHLHd gQfA== X-Gm-Message-State: AJcUukelqxUwg3LymxgUEOxsVqrzGI9RcxOHdNHKEK+ZdjWWO13uAA9j 74BnO7WzIuqbII7CtyH11h7oK11r7Qv3eQ== X-Google-Smtp-Source: ALg8bN4lA0UO3W1AU3ySVfcByCLh5MKFswBS61WbJjByqKm4m3PFGgFr55yHS9a+11cTsskjm0iyHQ== X-Received: by 2002:a2e:1b47:: with SMTP id b68-v6mr28302424ljb.104.1546870088432; Mon, 07 Jan 2019 06:08:08 -0800 (PST) Original-Received: from [10.9.0.4] ([185.65.135.162]) by smtp.googlemail.com with ESMTPSA id b21sm12551228lfi.7.2019.01.07.06.08.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jan 2019 06:08:07 -0800 (PST) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::236 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15207 Archived-At: On 1/5/19 2:22 PM, Catonano wrote: > > > Il giorno ven 4 gen 2019 alle ore 19:55 Zelphir Kaltstahl > > ha > scritto: > > Hi Guile Users, > > I have a question regarding the usage of SRFI 37. Is it possible > to have > long arguments, which one can use as follows: > > guile main.scm --argument value > > This is what I am used to with other command line programs. It > seems to > me, when I use SRFI 37, I can only get it to allow the following style > of command line arguments: > > guile main.scm --argument=value > guile main.scm --argument="some value" > > It is not really a big issue, but I think it would still be great to > have a way of allowing the first style as well, as I just spend an > hour > or so trying to figure out what was wrong with my program, until I > took > a look at my example code (see link below) again and checked how it > behaved with style 1 and noticed it has the same error. > > I have the example code, where I am trying to use SRFI 37, on: > > https://gitlab.com/zelphir-kaltstahl-projects/guile-scheme-tutorials-and-examples/blob/dev/command-line-arguments/using-srfi-37.scm > > Maybe I am missing something or doing something wrong? > > Regards, > > Zelphir > > > Hi Zelphir, > > I can't help you with the processing of arguments with Guile, as I > don't know the first thing about that > > I want to thank you for collecting that set of examples and tutorials > > I only skimmed through the macro section and it seems quite interesting > > Examples are very important and the Guile documentation sorely misses > some examples > > Also, I also had the experience to struggle and waste lots of time > with Guile for quite simple things, too > > For example, it too me some years to learn the usage of readline for a > better REPL experience (this information is sinked deep in the manual) > > It also too me a long time to get the gist of the "eval buffer" > command in Geiser > > You might be interested in this talk > https://archive.fosdem.org/2017/schedule/event/legacy_docs/ > > There is another library of examples that Tantalum pointed me to, this one > https://github.com/sph-mn/sph-lib/tree/master/modules/sph/server > > Together with yours, this material is becoming meaningful, if not > substantive > > Maybe the Guile website could point to these collections, maybe they > could be merged into one library only, we'll see > > For now I just wanted to acknowledge your effort > > Thanks The server example you linked to looks interesting. I still haven't used fibers. I am planning to do so, when I finally get to port my decision tree implementation from Racket to Guile, but I am not sure yet how to best make use of fibers. I could imaging running a fiber for each subtree (after each split a fiber could take care of learning the subtree), but where to stop? How many fibers are good and how many will cause no further speedup? And how to generalize that, so that I can calculate how many fibers to use and how to know how many fibers there are, without using global state and having concurrent modifications to it … maybe a pool of available fibers would work, or maybe decision trees are usually not that deep and starting a fiber for each subtree will be fine, as their overhead is supposed to be little. Or maybe there is not a general answer to this. I also have some TCP server and TCP client example somewhere, which could also make use of fibers, so maybe I can get some hints from the code you linked. I think however, there are many more things, for which examples would be nice to have. I think the Guile manual actually does a pretty good job of making things easy to discover, as far as procedures and modules go. Just sometimes it could need a more complete example of usage or so. I often wonder if I am doing things the way they should be done in Guile. So I am glad my repository is of help for anyone. As I figure out how to do things, I create the examples, so that I can look them up again once I start something new. If it is helpful for others as well, then even better. Regards, Zelphir