From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Sassmannshausen Newsgroups: gmane.lisp.guile.user Subject: Re: Beginner questions Date: Tue, 30 Oct 2018 14:15:06 +0100 Message-ID: <87ftwna84l.fsf@gmail.com> References: Reply-To: alex.sassmannshausen@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540905511 10443 195.159.176.226 (30 Oct 2018 13:18:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2018 13:18:31 +0000 (UTC) User-Agent: mu4e 1.0; emacs 26.1 Cc: guile-user@gnu.org To: swedebugia Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Oct 30 14:18:27 2018 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gHTub-0002Zu-Py for guile-user@m.gmane.org; Tue, 30 Oct 2018 14:18:25 +0100 Original-Received: from localhost ([::1]:53245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTwi-00040r-8z for guile-user@m.gmane.org; Tue, 30 Oct 2018 09:20:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTrb-0007jA-Ep for guile-user@gnu.org; Tue, 30 Oct 2018 09:15:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHTrW-00083G-M7 for guile-user@gnu.org; Tue, 30 Oct 2018 09:15:18 -0400 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:41696) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHTrU-0007v5-OZ for guile-user@gnu.org; Tue, 30 Oct 2018 09:15:14 -0400 Original-Received: by mail-wr1-x435.google.com with SMTP id x12-v6so12541316wrw.8 for ; Tue, 30 Oct 2018 06:15:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:reply-to:in-reply-to:date :message-id:mime-version; bh=tyB9D4sIN0jS8tqQTnQj/ZVqqGIbDpkY4nL37MUzAig=; b=RXahO9zy4uG5GP41wWf5sbVCXnzHv2+b4jsa/pq9q7afwDcbLXy3SA++EcyHqRodhx pCYnghLpbSho0wjO4Ku/gWH0yOHPlag+qZ8/sgw4APFAtb7VGx1RU1gztixP7op7cuOp xwZZTfr3TCafQoRt9PEVialQXG7YOy9e5wCOZLePd6h56qrCyaoOeVElP+Gy1CSLaUL7 tyVSRy5v5Ze04ej2UuW4LioSnMXkk8T3ft63Xp+3/GYasHRqVSVI79IXOVAsRnmsBtyF QXKlLhC40R0OEMxFxHeViuHMItBcxFoPbiWqcR9VFu52b8PJnqi9WxqHDXMzT2rqiFt4 MrkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :reply-to:in-reply-to:date:message-id:mime-version; bh=tyB9D4sIN0jS8tqQTnQj/ZVqqGIbDpkY4nL37MUzAig=; b=iJURRBuYuJdnsrqZMuCQA4tPzpUEQaX3aUlFTKWYsrhhxfIjSkfVnHyF027LAudZiP eymn/6XCCCKSIwXgr17D0trPcYovw/SQG+db7Giq8vBOQD0oT/0EDspj0VBXi1W5jtVi JI3/zxKl4Ep0aD6uBII8mGpksfkWduE1nQpFIGOFiaTMpfL935UDfK2+MB8CIEpijovu 9RJUVKvOi81pHUjC+iLKSLy1hq114FkkxHbwCPLKf9hfouKa62pZSqE58Ty0sklzM0gl QTqjfzduBDvJgct+psgKKgsAv/B3pNplwS9IiTn/1bdSuSZkGHGyUctjFyaBC9R9cN0Q /CbQ== X-Gm-Message-State: AGRZ1gJkwN6oLci1k/LGaZl9xWWCtNyZlIvIMTSrI7VULsU3w9Wg0+IQ KurhdoXDcTnC5oAwI44vMFbWQgppsgw= X-Google-Smtp-Source: AJdET5eiptXAj0Iqti0kjDzhoxdgkzHRNzB84x0qnYj5KtV3iMWQs5HKsXD+/EACEHM2HoXvbJcoIQ== X-Received: by 2002:adf:e70d:: with SMTP id c13-v6mr7844378wrm.50.1540905308056; Tue, 30 Oct 2018 06:15:08 -0700 (PDT) Original-Received: from rosser ([87.236.135.19]) by smtp.gmail.com with ESMTPSA id m16-v6sm14631288wmd.35.2018.10.30.06.15.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 06:15:07 -0700 (PDT) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 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:14952 Archived-At: Hello! swedebugia writes: > Hi > > I would like to learn more scheme and I would like to make a small CLI > program that runs in the terminal and prompts the user for input and > evaluates it. > > Is that possible with guile? In the REPL? > > Can someone point me in the right direction for succeding with that? In addition to what Tk recommends, here some pointers: - For commandline argument parsing & organization, you could specifically look at (ice-9 getopt-long). I think there's a srfi for some form of arg-fold, but I have not used that yet. In addition, you may want to look at guile-config (it's something that I wrote) which provides a more comprehensive way of structuring your entire CLI into different sub-commands and providing a nice structure for documenting your CLI. It's particularly easy to install through Guix. - For reading and writing interactively, you may want to look at the (read) and (write) procedures if you're intending to read & write s-expressions. Otherwise you may want to look at (ice-9 rdelim), which provides line based, or other delimiter based reading rather than s-expression reading. - You could also look at the readline library to be able to implement nice command line features if you decide to go down the full commandline path. Hope this helps. As Tk suggested, the documentation for Guile is great, if at points a little light on examples. Best wishes, Alex