From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 29B0322A46 for ; Fri, 19 Jan 2024 09:34:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id DAED7483F36 for ; Fri, 19 Jan 2024 09:33:28 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PNpsfpC_vZPd for ; Fri, 19 Jan 2024 09:33:28 +0100 (CET) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id E1262484290 for ; Fri, 19 Jan 2024 09:32:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 0D84B483F33 for ; Fri, 19 Jan 2024 09:31:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B88-BqsMOhLm for ; Fri, 19 Jan 2024 09:31:44 +0100 (CET) Received: from mail-ua1-f50.google.com (mail-ua1-f50.google.com [209.85.222.50]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id BC8A6483F32 for ; Fri, 19 Jan 2024 09:31:44 +0100 (CET) Received: by mail-ua1-f50.google.com with SMTP id a1e0cc1a2514c-7cd4d77e2ebso170523241.3 for ; Fri, 19 Jan 2024 00:31:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705653103; x=1706257903; darn=ntg.nl; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=gmnhlHN+cYteFsvteqZb3tlb1RUYkfZd5LPVFHn9uwU=; b=DCeRxsORA2/4NvvsFwBc6AqWXQOSTmp4tYsJYp/hRck8hyfkk8MYA7NQYsyGL3LRbh zrGHjIkfVST7Caa9YKp04wU+yN1KLVRau7DrS1MfG4Ubdkyrs4EZWmbkulC2RyasBjAr Hwj3mj5NELs72H6wmAszHlmidxxacLWjV3lchXDAcxIDA3gU3ox7hTnDkYKcvGz1teAW D6Bry8fs17Ai9ofrzY0jw5JjnHjU3aTb+ggjW/LSGmdzzOHJHFlj+utxd8lGbh9igS31 D4qIC5pIvgeGoxb8GqnTvstKZ57015Ey2Qot24daBfmTgxC21bdTjpGs91qCFRm0SamS COHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705653103; x=1706257903; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gmnhlHN+cYteFsvteqZb3tlb1RUYkfZd5LPVFHn9uwU=; b=LMITXY++Uc1pFuofI54w/bAFciFN34IEQZCU6Hj2Uzg5WqWrgHSAs76F2abSmfn0H7 IEr1ofqVar/EF8nLhNEbw0P+4yBNy+W6lTqFkF6brFyj6ukmOnEzr6MUHOgw5ep6PGAr b6j9Bjgzz46hfPmndot6OyyqwIFMesReEnaYTQIKhosE86alWzaDEsS+IWShjftjZoFZ IjREasYOSAJBSE4pWS6gqkN6cPdGC7kf8dp5WS0aNxx3i3zAuR428WgKjsefSifoKvrV 5SUtW+kT834mN+aoubQLq1TmJHT8pkKgE3RsUvbHqU2I7NQKjdiTi8tQayCOUCyt9jGW J/Og== X-Gm-Message-State: AOJu0YxgeMfyQReJMgLWjqG9MV+RFcQfetSJSjCMONK8GOGgut2/ReOs AIyfm9lTnhSw99mCYsmzIjYmpXDfUwE8N/3LdvLxvai0ONyooWiOa4cPnopbmZkv6rrJNUkmbTt sVsIJDotPcSwyj/sgjLzb/lECMRcoC7cf8uLHGg== X-Google-Smtp-Source: AGHT+IFg5BKQAaescajTBqx13Nckyw2e8LIhgAexEVTypjmoBWNfwR2OHZWZko7lir0+Kz/3hjd/AAwbqHTRjw7uudA= X-Received: by 2002:a1f:4b44:0:b0:4b7:daae:bd4d with SMTP id y65-20020a1f4b44000000b004b7daaebd4dmr1553528vka.11.1705653103283; Fri, 19 Jan 2024 00:31:43 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Shiv Shankar Dayal Date: Fri, 19 Jan 2024 14:01:31 +0530 Message-ID: To: mailing list for ConTeXt users Message-ID-Hash: 73RH6ZR6PFJSPKS4UCYF5CDAQ7MDEKPP X-Message-ID-Hash: 73RH6ZR6PFJSPKS4UCYF5CDAQ7MDEKPP X-MailFrom: shivshankar.dayal@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: LuaMetaTeX code List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============5286511522476386970==" --===============5286511522476386970== Content-Type: multipart/alternative; boundary="00000000000054dbfa060f484f51" --00000000000054dbfa060f484f51 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I see code like # define luametatex_version 210 # define luametatex_revision 10 # define luametatex_release 10 # define luametatex_version_string "2.10.10" starting with C99 these become unnecessary. Rather they should be like const int luametatex_version=3D210; const char* luametatex_version_string=3D"2.10.10"; These ensure type-safety in the code and are good coding practice. On Fri, Jan 19, 2024 at 1:56=E2=80=AFPM Shiv Shankar Dayal < shivshankar.dayal@gmail.com> wrote: > Dear Hans, > > I saw the C code of LuaMetaTeX and I saw a lot of gotos which is not good > coding practice. These potions of code which have goto should be refactor= ed. > > I am a C programmer, but I know very little of TeX. If you can point me > towards where should I start for TeX(perhaps TeX Book or TeX for the > Impatient), I can help with refactoring of code to make is more > efficient/easier. > > -- > Respect, > Shiv Shankar Dayal > --=20 Respect, Shiv Shankar Dayal --00000000000054dbfa060f484f51 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I see code like

# define lua= metatex_version =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0210
# define luameta= tex_revision =C2=A0 =C2=A0 =C2=A0 =C2=A0 10
# define luametatex_release = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A010
# define luametatex_version_st= ring =C2=A0 "2.10.10"

starting with C99 = these become unnecessary. Rather they should be like const int luametatex_v= ersion=3D210; const char* luametatex_version_string=3D"2.10.10";<= /div>

These ensure type-safety in the code and are good = coding practice.

On Fri, Jan 19, 2024 at 1:56=E2=80=AFPM Shiv Shan= kar Dayal <shivshankar.da= yal@gmail.com> wrote:
Dear Hans,

I sa= w the C code of LuaMetaTeX and I saw a lot of gotos which is not good codin= g practice. These potions of code which have goto should be refactored.

I am a C programmer, but I know very little of TeX. I= f you can point me towards where should I start for TeX(perhaps TeX Book or= TeX for the Impatient), I can help with refactoring of code to make is mor= e efficient/easier.

--
Respect,
Shiv Shankar Dayal


--
Respect,
Shiv Shankar Dayal
--00000000000054dbfa060f484f51-- --===============5286511522476386970== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --===============5286511522476386970==--