blob2list() and list2blob() ?

24 views
Skip to first unread message

Christian J. Robinson

unread,
Aug 28, 2021, 8:07:20 PM8/28/21
to Bram Moolenaar, vim_dev

I get that we can already iterate over a Blob like it’s a list, but some of my code would be far more efficient if I could convert a Blob to a List (and back again) using an internal Vim function rather than doing it with a for/endfor loop.   It would be a good match for the already extant str2list() and list2str().

 

Regards,

Christian

 

Christian J. Robinson

unread,
Aug 28, 2021, 8:20:38 PM8/28/21
to Bram Moolenaar, vim_dev
To be clear, I want to be able to convert to a list<number> and back to a blob.
--
Christian J. Robinson <hep...@gmail.com>

Bram Moolenaar

unread,
Aug 29, 2021, 6:37:28 AM8/29/21
to vim...@googlegroups.com, Christian J. Robinson, Bram Moolenaar
We could add those. I don't expect them to be used much, but if you
need them they should be more efficient.

--
DENNIS: Look, strange women lying on their backs in ponds handing out
swords ... that's no basis for a system of government. Supreme
executive power derives from a mandate from the masses, not from some
farcical aquatic ceremony.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

yega...@gmail.com

unread,
Sep 14, 2021, 10:07:53 PM9/14/21
to vim_dev
Hi,

On Saturday, August 28, 2021 at 5:20:38 PM UTC-7 Heptite wrote:
To be clear, I want to be able to convert to a list<number> and back to a blob.

I get that we can already iterate over a Blob like it’s a list, but some of my code would be far more efficient if I could convert a Blob to a List (and back again) using an internal Vim function rather than doing it with a for/endfor loop.   It would be a good match for the already extant str2list() and list2str().


Patch 8.2.3438 introduced the blob2list() and list2blob() functions.

- Yegappan
 

 

Regards,

Christian

 


Christian J. Robinson

unread,
Sep 14, 2021, 10:50:03 PM9/14/21
to vim_dev
Yeah, I saw that, and it works great. Thank you so much.

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/82a4e4b2-c19d-4fed-877a-6ed1e9198e4cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages