emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to add pseudo vector types


From: Eli Zaretskii
Subject: Re: How to add pseudo vector types
Date: Tue, 03 Aug 2021 16:03:27 +0300

> From: Fu Yuan <casouri@gmail.com>
> Date: Tue, 3 Aug 2021 08:50:45 -0400
> Cc: stephen_leake@stephe-leake.org, cpitclaudel@gmail.com,
>  monnier@iro.umontreal.ca, emacs-devel@gnu.org
> 
> > So in what sense are character positions easier to use than byte
> > positions?
> 
> Here are what you can do with positions:
> 
> - find the smallest node that encloses a range (BEG . END)
> - get the beginning and end of a node
> 
> Since all other functions use character position (eg, put-text-property, 
> point), using character positions saves lisp code some ‘position-to-bytes’. 

If you are talking about Lisp, then yes, character positions are a
much better interface.  But on the C level, sometimes you need byte
positions, sometimes character positions, and sometimes both.  Since
you didn't say what level was this about, I cannot say something more
intelligent.

> Internally, tree_sitter.c will continue to use byte positions, of course.

"Internally", as opposed to what?  And what is "internal" in this
context?  I thought we were talking only about the internals.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]