From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH 1/1] scm_set_source_properties_x: optimize if only name, line, and/or col Date: Tue, 09 Mar 2021 21:52:03 +0100 Message-ID: <87eego2gp8.fsf@pobox.com> References: <20210117222458.902736-1-rlb@defaultvalue.org> <3a393e11-15b4-6504-47da-aea9e950446d@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19388"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: guile-devel@gnu.org, Rob Browning To: Bruce Korb Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Mar 09 22:08:39 2021 Return-path: Envelope-to: guile-devel@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 1lJjao-0004vi-Ti for guile-devel@m.gmane-mx.org; Tue, 09 Mar 2021 22:08:38 +0100 Original-Received: from localhost ([::1]:40582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJjan-0001wH-Sk for guile-devel@m.gmane-mx.org; Tue, 09 Mar 2021 16:08:37 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50250) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJjL4-0006LF-29 for guile-devel@gnu.org; Tue, 09 Mar 2021 15:52:22 -0500 Original-Received: from fanzine.igalia.com ([178.60.130.6]:50310) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJjL1-0002aU-Qr; Tue, 09 Mar 2021 15:52:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=sZZxZXneYDFwfFNLKjAezL3LrdhH/bKWlIRjmZTqb10=; b=ZKqt+R2ZjDTds04zJw0vvH81XU8oGB1C4SNYPhrzJG42S3damYMLTVVJvvbQbiSdSvEUJfCXUiDurvm8ariYrqeobyI+j7pLRGeADgk0H1Ru8JegTruIB/O+UEqU6i1GyJ4C1yK5qeR2ECzczXMCj58IlLEusWB7nhwUAa/7iE0DFJAJb2zAV8Oc3akUyd1YAeu+Ar0Rl5PHcU0HXGN7Za8sRFHjrKIfvi5SaUANaL4EdRzjqYle62xLfmfSiOk4ygS8EzUk8LSD5l8m03INNqayJnReTprS760hLXkXP4BWw5dzk7Iv0a6kmv4H5OdQadYFj6J1pLRKTpKlVVOLUQ==; Original-Received: from 82-65-63-215.subs.proxad.net ([82.65.63.215] helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1lJjKw-0006tw-Fd; Tue, 09 Mar 2021 21:52:14 +0100 In-Reply-To: <3a393e11-15b4-6504-47da-aea9e950446d@gnu.org> (Bruce Korb's message of "Sun, 17 Jan 2021 14:55:53 -0800") Received-SPF: neutral client-ip=178.60.130.6; envelope-from=wingo@pobox.com; helo=fanzine.igalia.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20701 Archived-At: On Sun 17 Jan 2021 23:55, Bruce Korb writes: > [Can I] swap out this code for something better now? I've disliked > this code for years. > >> static SCM >> ag_scm_c_eval_string_from_file_line( >> =C2=A0=C2=A0=C2=A0 char const * pzExpr, char const * pzFile, int line) Since Guile 2.0.1 you can (use-modules (ice-9 eval-string)) (eval-string str #:file file #:line line) >From C: SCM_KEYWORD (k_file, "file"); SCM_KEYWORD (k_line, "line"); ... SCM ans =3D scm_call_5 (scm_c_public_ref ("ice-9 eval-string", "eval-string"), scm_from_utf8_string (str), k_file, scm_from utf8_string (file), k_line, scm_from_int (line)); Regards, Andy