unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vibhav Pant <vibhavp@gmail.com>
To: Mark Oteiza <mvoteiza@udel.edu>
Cc: "emacs-devel@gnu.org" <emacs-devel@gnu.org>
Subject: Re: master fffd4ff: ; etc/TODO: Remove 'switch' item, as it is now implemented.
Date: Tue, 14 Feb 2017 11:52:34 +0530	[thread overview]
Message-ID: <CA+T2Sh0ExU5nijPaeFzdcOFmWw+utef_kKqrr5mjcT76LG5yew@mail.gmail.com> (raw)
In-Reply-To: <87k28tsn57.fsf@holos>

On Tue, Feb 14, 2017 at 4:40 AM, Mark Oteiza <mvoteiza@udel.edu> wrote:
>
> vibhavp@gmail.com (Vibhav Pant) writes:
>> diff --git a/etc/TODO b/etc/TODO
>> index fc442f9..b102bdf 100644
>> --- a/etc/TODO
>> +++ b/etc/TODO
>> @@ -35,20 +35,6 @@ Change src/bytecode.c so that calls from byte-code functions to byte-code
>>  functions don't go through Ffuncall/funcall_lambda/exec_byte_code but instead
>>  stay within exec_byte_code.
>>
>> -** Add new 'switch' byte-code
>> -This byte-code would take one argument from the stack (the object to test)
>> -and one argument from the constant-pool (a switch table, implemented as an
>> -'eq' hash table) and would jump to the "label" contained in the hash table.
>> -
>> -Then add a 'case' special-form that can be compiled to this byte-code.
>> -This would behave just like cl-case, but instead of expanding to cond+eq it
>> -would be its own special form and would be compiled specially.
>> -
>> -Then change pcase to use 'case' when applicable.
>> -
>> -Then change the byte-compiler to recognize (cond ((eq x 'foo) bar) ...)
>> -and turn it into a 'case' for more efficient execution.
>
> What about the second and third items?

Both pcase and cl-cond are macros that expand to a cond form,
so they also compile to switch bytecode.

-- 
Vibhav Pant
vibhavp@gmail.com



  reply	other threads:[~2017-02-14  6:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170213172606.5097.68821@vcs0.savannah.gnu.org>
     [not found] ` <20170213172606.E451B232B9@vcs0.savannah.gnu.org>
2017-02-13 23:10   ` master fffd4ff: ; etc/TODO: Remove 'switch' item, as it is now implemented Mark Oteiza
2017-02-14  6:22     ` Vibhav Pant [this message]
2017-02-14 14:08     ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+T2Sh0ExU5nijPaeFzdcOFmWw+utef_kKqrr5mjcT76LG5yew@mail.gmail.com \
    --to=vibhavp@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=mvoteiza@udel.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).