* bug#47875: Elisp reader doesn't handle keywords
@ 2021-04-18 16:05 Leo Prikler
2021-05-13 22:43 ` Taylan Kammer
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Leo Prikler @ 2021-04-18 16:05 UTC (permalink / raw)
To: 47875
Hi Guilers,
Using Guile 3.0.5, the elisp reader does not seem to support keywords
written in Elisp's preferred prefix-style notation (:keyword).
scheme@(guile-user)> ,L elisp
Happy hacking with Emacs Lisp! To switch back, type `,L scheme'.
elisp@(guile-user)> :keyword
ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Unbound variable: :keyword
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
elisp@(guile-user) [1]> ,q
elisp@(guile-user)> (funcall (@ (guile) symbol->keyword) 'keyword)
$1 = #:keyword
Meanwhile in Emacs M-: :keyword yields :keyword. Using Scheme-style
keywords also does not work:
elisp@(guile-user)> #:keyword
While compiling expression:
uninterned symbol cannot be saved to object file #<uninterned-symbol
keyword 7fb39fa4b5e0>
I think Guile should produce keyword objects for the former, so that we
don't need to talk about the latter.
Regards,
Leo
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#47875: Elisp reader doesn't handle keywords
2021-04-18 16:05 bug#47875: Elisp reader doesn't handle keywords Leo Prikler
@ 2021-05-13 22:43 ` Taylan Kammer
2021-06-04 12:13 ` Ivan Sokolov
[not found] ` <87lf7onwcp.fsf@ya.ru>
2 siblings, 0 replies; 5+ messages in thread
From: Taylan Kammer @ 2021-05-13 22:43 UTC (permalink / raw)
To: 47875, Leo Prikler
This seems to have been fixed in the wip-elisp branch.
Note that the branch is a couple years old. There's a version
of the branch by Ricardo Wurmus (rekado) that's been rebased on
a newer version of Guile, though still not on 3.0:
https://git.elephly.net/?p=software/guile.git;a=shortlog;h=refs/heads/wip-elisp
- Taylan
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#47875: Elisp reader doesn't handle keywords
2021-04-18 16:05 bug#47875: Elisp reader doesn't handle keywords Leo Prikler
2021-05-13 22:43 ` Taylan Kammer
@ 2021-06-04 12:13 ` Ivan Sokolov
[not found] ` <87lf7onwcp.fsf@ya.ru>
2 siblings, 0 replies; 5+ messages in thread
From: Ivan Sokolov @ 2021-06-04 12:13 UTC (permalink / raw)
To: 47875
Leo Prikler <leo.prikler@student.tugraz.at> writes:
> Using Guile 3.0.5, the elisp reader does not seem to support keywords
> written in Elisp's preferred prefix-style notation (:keyword).
>
> Meanwhile in Emacs M-: :keyword yields :keyword. Using Scheme-style
> keywords also does not work:
>
> I think Guile should produce keyword objects for the former, so that we
> don't need to talk about the latter.
In Scheme keywords and symbols are separate entities, but in Elisp
keywords are just self-quoted symbols. I think your solution will cause
problems with Elisp algorithms that expect keywords to be symbolp.
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#47875: Elisp reader doesn't handle keywords
[not found] ` <87lf7onwcp.fsf@ya.ru>
@ 2021-06-05 21:14 ` Leo Prikler
2021-06-06 18:21 ` Ivan Sokolov
0 siblings, 1 reply; 5+ messages in thread
From: Leo Prikler @ 2021-06-05 21:14 UTC (permalink / raw)
To: Ivan Sokolov; +Cc: 47875
Am Samstag, den 05.06.2021, 18:51 +0300 schrieb Ivan Sokolov:
> In Scheme keywords and symbols are separate entities, but in Elisp
> keywords are just self-quoted symbols. I think your solution will
> cause problems with Elisp algorithms that expect keywords to be
> symbolp.
You could define Elisp symbolp as
(lambda (thing)
(or (funcall (@ (guile) symbol?) thing)
(funcall (@ (guile) keyword?) thing)))
but perhaps there's an even faster way to check this property.
The other way round – using Emacs keywords as Scheme symbols – will not
perform well if you think about Emacs code calling a Scheme function
that expects keywords.
Regards,
Leo
^ permalink raw reply [flat|nested] 5+ messages in thread
* bug#47875: Elisp reader doesn't handle keywords
2021-06-05 21:14 ` Leo Prikler
@ 2021-06-06 18:21 ` Ivan Sokolov
0 siblings, 0 replies; 5+ messages in thread
From: Ivan Sokolov @ 2021-06-06 18:21 UTC (permalink / raw)
To: Leo Prikler; +Cc: 47875
Leo Prikler <leo.prikler@student.tugraz.at> writes:
> You could define Elisp symbolp as
> (lambda (thing)
> (or (funcall (@ (guile) symbol?) thing)
> (funcall (@ (guile) keyword?) thing)))
You are right, I haven't thought about changing the implementaion of
symbolp.
> but perhaps there's an even faster way to check this property.
Use guile-primitive instead of guile-ref? Both symbol? and keyword? are
primitives.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-06-06 18:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-18 16:05 bug#47875: Elisp reader doesn't handle keywords Leo Prikler
2021-05-13 22:43 ` Taylan Kammer
2021-06-04 12:13 ` Ivan Sokolov
[not found] ` <87lf7onwcp.fsf@ya.ru>
2021-06-05 21:14 ` Leo Prikler
2021-06-06 18:21 ` Ivan Sokolov
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).