From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f53.google.com ([209.85.221.53]) by ewsd; Sun Nov 11 16:07:46 EST 2018 Received: by mail-wr1-f53.google.com with SMTP id j17-v6so7163383wrq.11 for <9front@9front.org>; Sun, 11 Nov 2018 13:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:references:content-disposition :in-reply-to; bh=DUlTUTPrWTWs0Ad1jKV7joJhv/cNVBO2Jb76h2jbqf0=; b=I/OgVtoT+WP0lNgNw1BpITlrPUnP2naDxV/hR7P4tSo5jpvm/VNTG0E870lhUNqU41 Tob6EvkUB9bBZmLbRLvzUZRaZcMN3ONSFjZgljcmx8qeQFkDFDMJ1PmNKryD1rSKIDek bQsQCMsrUbxkZ2BGO0RFfUKgxZzOye20NLj5aiF+amrRxmJ5aKcaBC2av1Eab7Vg0xNa hBtC2JnsewvKO+SP8jTi8zZAv2RYLV/yg69bF7agKaTUnyjC8LjXmUpFuyH9vtkuigjo NGXr1WY0e0WN/zSiFnFRgIHDpISYrghN9o6jasHMbBP3qz++UL+D2U7LytyoueEZ6Zfs lkPQ== 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:subject:message-id:references :content-disposition:in-reply-to; bh=DUlTUTPrWTWs0Ad1jKV7joJhv/cNVBO2Jb76h2jbqf0=; b=rahChcMkzDHPIpMNxHgkY/LjE2RjAW1Eo/6j7Ekpe8Xx0sgNkMCY56Xt1uzDm8s6rL pqg0uFN0Y7UuOu+jT2ijRGA+1FC82fLBmfSc3bk6j3k26AR2Bf9FKwf1GfAjgGQnM1oT KBBL/cwYqAdPIkVevUYG+pk98lcIk0ogg1rrutel8fGYDV0FvI9lFY9SFHOCUzmPWtD1 L2yook8lDoPqvudJ9bc6eFF203m4SWkzH+T/gnIMFI+d3ng41C7/m93j3YBkSei4zYwW XPodIHcjBopG9dXNKQ3IcQ8SfL/9dla7aBxDA7iUFVqbVum/zY5R0Cqttxypcw8TSKhp 01OQ== X-Gm-Message-State: AGRZ1gLAD4RU6j7gYEUEn0l2UX4LTg9bXUGmsmB7Pp0rzpyOXdPp3Odi lbn2xTGJFSR+jYROI4qNJajGheYc X-Google-Smtp-Source: AJdET5cZdA4+jJBpOYukvNby6ptr9fm/2jyE0sAF6z+izUlXESBtzubKj++wJPwk9XJ6CaN5NR/vvw== X-Received: by 2002:a5d:4d4e:: with SMTP id a14-v6mr14813480wru.316.1541956455798; Sun, 11 Nov 2018 09:14:15 -0800 (PST) Return-Path: Received: from master.localdomain (ip72-200-124-203.tc.ph.cox.net. [72.200.124.203]) by smtp.gmail.com with ESMTPSA id v62-v6sm5456793wme.3.2018.11.11.09.14.14 for <9front@9front.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Nov 2018 09:14:15 -0800 (PST) Date: Sun, 11 Nov 2018 10:14:11 -0700 From: Joe M To: 9front@9front.org Subject: Re: [9front] man rc patch Message-ID: <20181111171411.GA8793@master> References: <666DC733283F0655D5B3D817FDB6BF28@musolino.id.au> <1541935934.1883208.1572931672.480E2ACD@webmail.messagingengine.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1541935934.1883208.1572931672.480E2ACD@webmail.messagingengine.com> List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: proven object-oriented deep-learning generator > On Sun, Nov 11, 2018, at 6:59 AM, Alex Musolino wrote: > > Why not just fix it? This patch [1] seems to do the trick for me. > > > > Perhaps also worth mentioning is that $"1 is redundant, since $#1 is > > always 1; just say $1. Thanks for the patch. > why add code to support something which doesn't make sense? :) i thought it was a bug years ago, but then i realised there is no need for it. unlike the bourne shell, rc doesn't have an obsession with breaking up strings. once you've got a string in a variable, it's not going to be split again unless passed to eval. in fact, supporting $"1 could be said to be deceitful, hiding this great feature from newcomers. ;) I am trying to avoid the 'rc: null list in evaluation' messages when using $1 when there is no first argument. The $"1 outputs a blank string instead of failing with that error message. Thanks #!/bin/rc fn t{ echo '$1 is' $1 echo '$"1 is' $"1 echo '$#1 is' $#1 echo '$2 is' $2 echo '$"2 is' $"2 echo '$#2 is' $#2 echo 'testing concatenation of $1 '$2 } t 100 ; rc /tmp/test.rc $1 is 100 $"1 is $#1 is 1 $2 is $"2 is $#2 is 0 rc: null list in concatenation ;