unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: [modules] Possible return values of the env->type_of?
Date: Fri, 22 Jun 2018 21:10:18 +0300	[thread overview]
Message-ID: <8336xer8tx.fsf@gnu.org> (raw)
In-Reply-To: <CAFyQvY2coP24Od7Kvop_67JPNzRDtkAfAUCX4sxbnjapFYpzTw@mail.gmail.com> (message from Kaushal Modi on Fri, 22 Jun 2018 10:41:35 -0400)

> From: Kaushal Modi <kaushal.modi@gmail.com>
> Date: Fri, 22 Jun 2018 10:41:35 -0400
> 
>   (should (eq 'cons (modtest-get-type '(1 2 3)))) ;Interestingly, this is a
> "cons" too.
>   (should (eq 'cons (modtest-get-type (list 1 2 3))))) ;.. and this too!
> 
> Below code[3] is in Nim that creates that Elisp modtest-get-type function;
> it's a light wrapper that calls the type_of Modules API function:
> 
> emacs.defun(get_type, 1):
>   ## Returns the Emacs-Lisp symbol of the argument type.
>   env.type_of(env, args[0])
> 
> Is this expected? I was expecting the type symbol returned for the last two
> tests above to be 'list.

There's no such type as 'list', it's just a cons cell with a special
cdr.



      parent reply	other threads:[~2018-06-22 18:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-22 14:41 [modules] Possible return values of the env->type_of? Kaushal Modi
2018-06-22 17:10 ` Kaushal Modi
2018-06-22 17:38 ` Aurélien Aptel
2018-06-22 17:52   ` Kaushal Modi
2018-06-22 18:16     ` Eli Zaretskii
2018-12-25 16:13     ` Philipp Stephani
2018-06-22 20:58   ` Drew Adams
2018-06-22 18:10 ` Eli Zaretskii [this message]

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=8336xer8tx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    /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.
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).