GNU bug report logs - #61660
[feature request] optimization of case-lambda

Previous Next

Package: guile;

Reported by: lloda <lloda <at> sarc.name>

Date: Mon, 20 Feb 2023 17:57:02 UTC

Severity: wishlist

Tags: patch

Done: lloda <lloda <at> sarc.name>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: lloda <lloda <at> sarc.name>
To: "bug-guile <at> gnu.org" <bug-guile <at> gnu.org>
Subject: [feature request] optimization of case-lambda
Date: Mon, 20 Feb 2023 18:56:25 +0100
On 3.0.9


> ,optimize ((case-lambda (() 0)))
= 0

but 

> ,optimize ((case-lambda (() 0) ((a) 1)))
= ((case-lambda (() 0) ((a) 1)))


The problem with this is that when the output of a macro contains case-lambda, recursive application results in geometrical increase of code size. It seems that it should be possible to resolve the application on the spot; at last to reduce the case-lambda to a simple lambda when the arity is available (which now only happens when the case-lambda contains a single clause).

Thanks

  Daniel






This bug report was last modified 2 years and 89 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.