On Fri, Oct 30, 2020 at 2:19 PM Elizabeth Mattijsen <l...@dijkmat.nl> wrote:

> > On 30 Oct 2020, at 22:11, Sean McAfee <eef...@gmail.com> wrote:
> >     > sum <46 20 26 87 11> Z* (1, * * 101 ... *)
> >     123456789
> >
> > ...but I'm hoping there's something more concise, shorter, and/or
> readable.
>
> Ah, so it's not about parsing per se.  Sorry I misunderstood.
>
> So you'd basically need a sub that takes a List, and a base factor, and
> does the necessary arithmetic for you.  I don't think that's in core.  I'd
> be glad if someone proved me wrong  :-)
>

Well, not necessarily even a sub.  Just an expression.

My specific use case at the moment is a golf challenge where I have a list
of objects, some of which are Nil, and I want to create a number from them
where the Nil values are treated as a binary 0 digit and the non-Nil values
as a binary 1 digit, and I'm currently doing it like this:

    :2((+«?«@some-are-Nil).join)

As I mentioned, I feel like I've seen a short way to make a number from its
digits, but now I can't remember it.  I could be wrong.  But if it exists
I'm hoping it would let me shave off a few bytes.

Reply via email to