From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Catonano Newsgroups: gmane.lisp.guile.user Subject: Re: Beginner questions Date: Tue, 27 Nov 2018 20:59:12 +0100 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1543348669 21029 195.159.176.226 (27 Nov 2018 19:57:49 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 27 Nov 2018 19:57:49 +0000 (UTC) Cc: Guile User To: neil@ossau.homelinux.net Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Nov 27 20:57:45 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 1gRjUP-0005O7-Bg for guile-user@m.gmane.org; Tue, 27 Nov 2018 20:57:45 +0100 Original-Received: from localhost ([::1]:44248 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRjWV-0005rm-QC for guile-user@m.gmane.org; Tue, 27 Nov 2018 14:59:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRjW8-0005rW-36 for guile-user@gnu.org; Tue, 27 Nov 2018 14:59:33 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRjW6-0007fP-Ux for guile-user@gnu.org; Tue, 27 Nov 2018 14:59:32 -0500 Original-Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]:36835) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRjW6-0007eQ-Q6 for guile-user@gnu.org; Tue, 27 Nov 2018 14:59:30 -0500 Original-Received: by mail-yb1-xb2a.google.com with SMTP id g192-v6so9604784ybf.3 for ; Tue, 27 Nov 2018 11:59:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pi/eEZG2wrrs2XGlazUhKIkb8Dhc+aTOxB0+jHZhNTQ=; b=GncgoyQQeBQm/q6i/Tsz69C9+Qv2uK07MXsR9F3QyW7JoD6stYpxGpO9WJ45h4Tdg+ ZgoSJYhc4H7HvdOzCgwtz/lEfkfs8CQx01yM4iNynBtBDyrQTuH5Oz1elyCJODzeW/Pu TthyRvlhPdlQHKaJasvdg6RRsga1OX8aaWnjzE//6f0cERb1csnbQtayEJkWl8T9UeMF +7hp5w7MMx0KiFLV00RTHj8PqstpWmJHDRI6QqvE/18WxVh76RgGkdiV1waQ+SQ0hhHe 3palgFuG/D/O352bxAgJo4nnIiMjnBIQmBVZa9IF4AsUj3ZsbdepOvfrisw/2LfqHlmu +CPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pi/eEZG2wrrs2XGlazUhKIkb8Dhc+aTOxB0+jHZhNTQ=; b=rc/J9of3p0M4k/vw/2hoWOA3/At60Amk6zH02DKJF/aq83Azy9ZcNpVPJnHIilEZnU ghFlO11KzEcelFAdqTi6B675LqByW2SWIv46WfHwI0vLoqrYUJ+o8jWlUo2Vh8pa04qe N3EMyU+bu/vuzwGB9JXjuVnlTEyUxXd24lB+8DN/q1ZBwNerWlHxo4wf22RONm/KAj96 yiZv7JwO9nI4fLGOXVv01OuFm7bn+VbssFYXlSufU4LG2JxRjaZFYeof7OpziLtE7A7M Y3vL+ERKb9ONPenLfc12RmH7C4EEUDA1frQoVhGzkssdDAas9K3gV08NRDY1/rNZuFKk ielw== X-Gm-Message-State: AA+aEWZnxZXnwkYlAdGFsNloytSLIiYvdLDX0icKCTa5LnI00lPm2E9A 2/Z43qy4zzrLyWW/m2JuqnGRyx8yKQ7ZZbPWVg== X-Google-Smtp-Source: AFSGD/WJ5BdNNU1wBhzKUueOes7Yz8tdMZ3y6tm3RYlKwTtY9t/S9OvBGrfQ/5tVx2nSOTJ8sVN+5rszGUV1891H30E= X-Received: by 2002:a25:ba46:: with SMTP id z6-v6mr34233095ybj.296.1543348767080; Tue, 27 Nov 2018 11:59:27 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::b2a 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:15017 Archived-At: Neil, Il giorno lun 19 nov 2018 alle ore 10:02 Neil Jerram < neil@ossau.homelinux.net> ha scritto: > > > On 18 November 2018 19:33:31 GMT, Catonano wrote: > >Il giorno lun 29 ott 2018 alle ore 22:58 swedebugia > > > >ha scritto: > > > >> 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? > >> > >> > >> > > > > Hi > > > >I am curious: did you manage to put together a prototype of this thing > >prompting a user in the terminal ? > > In case it's of interest, I wrote this kind of thing a few years ago: a > command loop for Guile where you can register possible commands, and each > command has a spec like the Emacs 'interactive' form that says what the > args are and how to prompt for them. > > The command loop entry point is at > http://git.savannah.nongnu.org/cgit/ossaulib.git/tree/ossau/command-loop.scm > and the dependency modules are all included in that git repo. > > Best wishes, > Neil > thank you But I'm a bit overwhelmed by so much code a tiny example of reading a short string that a user could type at a prompt would be more useful to a beginner, I think I came up with this short example (use-modules (ice-9 rdelim)) (let ((str (read-line (current-input-port)))) (display (string-append str "\n"))) it's extremely essential but it demonstrates the usage of the current input port in association with delimited text reading This is a very basic use case, intended as an example, a step 0 for further developments Guile could use some more examples, in its manual Thanks !