From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9074CC07E99 for ; Mon, 5 Jul 2021 19:53:59 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6CF836196A for ; Mon, 5 Jul 2021 19:53:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6CF836196A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4F58F82BE4; Mon, 5 Jul 2021 21:53:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="VQwY+gld"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8FFCD82BF4; Mon, 5 Jul 2021 21:53:54 +0200 (CEST) Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3516B82BE3 for ; Mon, 5 Jul 2021 21:53:50 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x72f.google.com with SMTP id a4so10036071qkn.11 for ; Mon, 05 Jul 2021 12:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kPQ7u+3fpuu29iT55LjSLShLYQECp6d9bSmTxeyvA7o=; b=VQwY+gldMbijKsix2VC4naU1shx6Ov+B8UqKrpUOGisq0psq0w2ihRjJ0AftDKaes+ xqkMguaf6+mRpQvkdi5AYdIt/jdhiRJ2gr6oyu279MiuLLHNy4Rx6E6ctbWfcbNTzm7a cobWhsgSyln0U0uHIcYy0xwbogKe+aBRGtENE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kPQ7u+3fpuu29iT55LjSLShLYQECp6d9bSmTxeyvA7o=; b=pJlWMvcgdnPyecx4VUEnuAANSVLLck/g81Pe204ZRpmFvnIeiXpU/3o7VdnjwSkZdo 7SA26/ZwAP5QtLH0+x88XvSEORJUQXnSztjfrveQarM9WhFAg+bcVNleFSorTEqQKd9C xVG6HaaRgzT79+kGgphQICU9uty4BE+V5KyNf4gfO/emIIdVMeIjE9VoOUj8qSPrtdCN 5Pf9wGSir6I/CwcThBf/f5ck0xLZ/H9zSNzfsBrZY4/uPcm07nVjkiacq0Jet9UrWkZu S5I1SpGHX1AdT7HGjAyxWm7Bw0ZOPoeFkkCk1UBYuRc03msdAL6wHxYnC/2uAO2u/Dpy a/Ow== X-Gm-Message-State: AOAM530l/ly/2v4L/oEIdDa/O+YdkoFxT7+eNJraOofGLmC/FBL+nTY0 tgywXyyfo+alg7Uu+WIKJU9uAA== X-Google-Smtp-Source: ABdhPJxd4laeohMFNnmRURRk8MZx++zbi0KvzN3Td4JEuNVzTnvu+nLI25kYI/7LsimyOsKzU/OrrQ== X-Received: by 2002:a37:5c43:: with SMTP id q64mr15870760qkb.117.1625514829040; Mon, 05 Jul 2021 12:53:49 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-5170-f33c-21eb-73eb.res6.spectrum.com. [2603:6081:7b01:cbda:5170:f33c:21eb:73eb]) by smtp.gmail.com with ESMTPSA id x3sm3341137qkj.105.2021.07.05.12.53.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 05 Jul 2021 12:53:48 -0700 (PDT) Date: Mon, 5 Jul 2021 15:53:45 -0400 From: Tom Rini To: Sean Anderson Cc: Wolfgang Denk , u-boot@lists.denx.de, Marek =?iso-8859-1?Q?Beh=FAn?= , Simon Glass , Roland Gaudig , Heinrich Schuchardt , Kostas Michalopoulos Subject: Re: [RFC PATCH 02/28] cli: Add LIL shell Message-ID: <20210705195345.GC9516@bill-the-cat> References: <20210701061611.957918-1-seanga2@gmail.com> <20210701061611.957918-3-seanga2@gmail.com> <126700.1625223815@gemini.denx.de> <8bbdb7a1-5085-a3b7-614f-12ae9aee8e8b@gmail.com> <18831.1625340810@gemini.denx.de> <20210705191058.GB9516@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="75Klpb9n7AtImEVY" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.9.4 (2018-02-28) X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --75Klpb9n7AtImEVY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jul 05, 2021 at 03:47:47PM -0400, Sean Anderson wrote: > On 7/5/21 3:10 PM, Tom Rini wrote: > > On Sat, Jul 03, 2021 at 09:33:30PM +0200, Wolfgang Denk wrote: > > > Dear Sean, > > >=20 > > > In message <8bbdb7a1-5085-a3b7-614f-12ae9aee8e8b@gmail.com> you wrote: > > > >=20 > > > > > For a partial list, see > > > > >=20 > > > > > [1] https://github.com/Forty-Bot/lil/commits/master > > > >=20 > > > > Whoops, looks like I completely misread what you were asking here. I > > > > don't have an exhaustive list of differences, but here are some sim= ilar > > > > things expressed in both languages: > > > >=20 > > > > sh tcl > > > >=20 > > > > foo=3Dbar set foo bar > > > > echo $foo echo $foo > > > >=20 > > > > if [ 1 -gt 2 ]; then if {1 > 2} { > > > > echo a echo a > > > > else } { > > > > echo b echo b > > > > fi } >=20 > The left side is possible with something like >=20 > if itest 1 -gt 2; then # etc. >=20 > > > >=20 > > > > foo() { proc foo {first second} { > > > > echo $1 $2 echo $first $second > > > > } } >=20 > This is not possible. We only have eval (run) as of today. I view adding > functions as one of the most important usability improvements we can > make. >=20 > > > >=20 > > > > for file in $(ls *.c); do foreach file [glob *.c] { > > > > echo $file echo $file > > > > done } >=20 > This is possible only if you already have a list of files. For example, > one could do >=20 > part list mmc 0 -bootable parts > for p in $parts; do #etc >=20 > but the part command is one of the only ones which produces output in > the correct format. If you want to (e.g.) dynamically construct a list > you will have a much harder time. >=20 > > > > fact() { > > > > if [ $1 -eq 0 ]; then > > > > echo 1 > > > > else > > > > echo $(($1 * $(fact $(($1 - 1))))) > > > > fi > > > > } >=20 > This is technically possible with run and setexpr, but fairly cumbersome > to do. >=20 > > > >=20 > > > > proc fact {n} { > > > > if {$n} { > > > > expr {$n * [fact [expr {$n - 1}]]} > > > > } { > > > > return 1 > > > > } > > > > } > > > >=20 > > > > Hopefully this gives you a bit of a feel for the basic differences. > >=20 > > Which of these things, from each column, can you do in the context of > > U-Boot? That's important too. >=20 > See above. And for clarity, on the LIL side, with a few things like needing to bring in the list of files somehow, all of those would work in U-Boot? --=20 Tom --75Klpb9n7AtImEVY Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmDjY0YACgkQFHw5/5Y0 tyybWgv+IXuUPUYfC6xOI7Fg2rjjSUPCaO+KzboQvGTEiZUxv+9BhbYz6Z76kea1 PHPby6jf/5sUMU2cENOjaRgsdeKgbGwK0arrx22zAQvu0qIOWzF3uFuR8BkRq20y xGUdX6YzESStSRyeGGn3MAbvXFRNf8IAJ+NzlOG+6sELXwkMKxMcmBXvK1T8BXgM 3cIbYpC7BVSsSU8GNGRIbPTJ6d0Gci7v4+lyDJWeUbUs9EjGjjEW0bUTaGmMAhDO vzPUrbeR914gca14npHoM3bWwr8w3stM5SdvG/CtXGPUDbeMAbUeXv5zZj1Y6Gba Yq4WNVnj2/xcL2iq1QP+oNtQ6MoQ8PbtNOSRna8AQCbc+yI1GNZfezLVqCzjva9X z5Mh7vCFwT0lIn+Sw1bcm/QagqIJUSfkMFwNYO6tfJxfm/hppkJWYPY+a0SWImqv jpaUNAphCXEHLqhaEE+j4b8Q1d/jZFi+NNlQW91Py+dPNcbuk9rLJsUJCNV5CLTX cR2tPDJs =ZrCY -----END PGP SIGNATURE----- --75Klpb9n7AtImEVY--