From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help Subject: Re: let*: Wrong type argument: stringp, nil Date: Wed, 29 Sep 2021 14:17:02 +0800 Message-ID: References: <87lf3lrmos.fsf@gmx.net> <87ee9csyp0.fsf@gmx.net> <87a6k0sogz.fsf@gmx.net> <878rzgq9re.fsf@zoho.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32359"; mail-complaints-to="usenet@ciao.gmane.io" To: Emanuel Berg , help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 29 08:18:22 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mVSv8-0008Ey-8b for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 29 Sep 2021 08:18:22 +0200 Original-Received: from localhost ([::1]:60378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVSv7-00021v-BS for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 29 Sep 2021 02:18:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32776) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVSu6-0001zI-8m for help-gnu-emacs@gnu.org; Wed, 29 Sep 2021 02:17:18 -0400 Original-Received: from mail-vs1-xe2f.google.com ([2607:f8b0:4864:20::e2f]:35817) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVSu4-0003yJ-Lc for help-gnu-emacs@gnu.org; Wed, 29 Sep 2021 02:17:18 -0400 Original-Received: by mail-vs1-xe2f.google.com with SMTP id f18so1693692vsp.2 for ; Tue, 28 Sep 2021 23:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=45WHbs/AX9iN8iijv6cni9tUE29LAtmx0rU5bc3/W0I=; b=m8pLWL/6N7njqVuwWz4D7L4edt0Scd8DaLGkzj+RolMcCO+SeLPI7vDnaC/4/0o2B8 Li1M0yn+mYVNvKEZr45IWCHanMqqy2z5c1RHul3SuRGq90kQ5Ks/1ne+EN3F4cfu9k0u m1F81eo60+1j1Znlb5Qm3IPjT1OWI8UxG/+qSNtZ4S8r4See0jjAiWDw+GLUR7ESxXHA 0bav0zmaowfyMuAA76Ch7r1BF0+YLH86c7PG39MyIVrgnptZfUdpV+bJC7DaV871IoKG h5NV5jUFn251AmjJTS06omGBgMsD+8lQSNZh4KjgxObGR1z1rkp6Q6pj7WjYtAAZLJ7q k4Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=45WHbs/AX9iN8iijv6cni9tUE29LAtmx0rU5bc3/W0I=; b=ZQam6Giu7ilKzSeyV9nDMn9tptMzt6dtf2fvApsypPKkJ727mOvD9yocgnH4vcUygh T5u4XlvneoZzQwf+FMZiQuZIubTFzG3tPdUsbjdFJvS/CFA9vy++25izLgsHDJRk9FQJ McCk36s7beAnFFeZ3HvzlqnK//wi/rsw7dEcqTesOs2XlipQ7i6MszHlzrrwhj/PxVJb y9EBSBqn1kEyrjmUubJlWKvGWoE49mDLXLcSVz1XxBcYoUaUFu8OPr2n9lAKLRnbscV4 lSTarl2NEUgXzxUJmD4OHxsrztLsAujp9yet79naDLuATURuroGpxcPuBtu2P3JBZYXA AOXg== X-Gm-Message-State: AOAM530dym+EAFYmTWxjNbIf3NCsp7z9fCvah/1hZLgCVz8d2ik0y82g rXCC3/0SJbnD6D9fbOMvhwD/dOly5JaXv+6Qny8= X-Google-Smtp-Source: ABdhPJxmpsrASoCu54vRYLZh/bir+Xn1BDWC2tomkI1t2OCch+fJ4/QvhA3ups8tqqfv98K0eR5oDnhWYSEgM/71W3c= X-Received: by 2002:a67:3157:: with SMTP id x84mr8963477vsx.51.1632896233091; Tue, 28 Sep 2021 23:17:13 -0700 (PDT) In-Reply-To: <878rzgq9re.fsf@zoho.eu> Received-SPF: pass client-ip=2607:f8b0:4864:20::e2f; envelope-from=hongyi.zhao@gmail.com; helo=mail-vs1-xe2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133376 Archived-At: On Wed, Sep 29, 2021 at 12:35 PM Emanuel Berg via Users list for the GNU Emacs text editor wrote: > > Hongyi Zhao wrote: > > > (defun try/pyvenv-workon () > > (when (locate-dominating-file (buffer-file-name) ".python-version") > > ;https://emacs.stackexchange.com/questions/9474/let-statement-throws-error-on-assigning-a-form-to-a-variable > > (let ((file (concat (locate-dominating-file (buffer-file-name) > > ".python-version") ".python-version"))) > > (pyvenv-workon (with-temp-buffer > > (insert-file-contents file) > > (nth 0 (split-string (buffer-string)))))))) > > > > BTW, should I use `let' or `let*' here? > > `let*' always works, `let' works when there is no references > to previous bindings in any binding... > > So if it works and you have let, you have done the > right thing! > > In theory, because of the independence of the individual > bindings with let, it can be used to compute in parallel - but > I don't think that actually happens - an urban legend ... > > In your code you only have "file" so while both would work, > let* is unnecessary ... Wonderful explanation. Got it. Thank you very much again. HZ