« first day (33 days earlier)      last day (242 days later) » 

03:48
@mathcat do the same thing as str-int but output as ascii
(or just steal from vyxal)
 
6 hours later…
09:45
@PyGamer0 yeah, maybe
 
5 hours later…
14:48
@mathcat how should we implement interleave?
nice
question
*me making a CMC out of it*
@BgilMidol its easy
Ok
Should I make a interleave function in functions.py?
maybe a new file called function_helpers?
so if i understand interleave, its just [1, 2, 3] * [3, 4, 1] -> [1, 3, 2, 4, 3, 1] right?
I think so.
14:51
@BgilMidol do it in that i suppose
@BgilMidol ok so here is how flax does it
where iterable just converts x to a list if it isnt already one
it is the itertools module
flatten is just list(mit.collapse(x))
@mathcat should I make a interleave function in functions.py? or somewhere else?
where mit is the more_itertools module
@BgilMidol I think it's better when it's in functions.py, because it is an element
actually, because flatten will probably be an element in Noxan
a flatten function would be good
14:59
proceeds to generate a random unicode char
got ǯ
got È
@PyGamer0 thanks
@BgilMidol how about F for flatten?
æ ƙ ū Ȅ ĕ Ľ ƴ Ĩ Ĺ LJ
How about LJ for flatten
15:02
are you going to use ascii characters for elements?
no
ĕ is for interleave
Can't seem to download more_itertools
I guess I'll make my own
@BgilMidol what would str*str be then?
@mathcat oh yeah
@BgilMidol pip install more_itertools?
@PyGamer0 oh
I typed pip install more-itertools
15:04
@PyGamer0 pip modules don't have underscores
Still doesn't work.
error?
no, "requirement already satisfied"
λ pip install more_itertools
Requirement already satisfied: more_itertools in /data/data/com.termux/files/usr/lib/python3.10/site-packages (8.12.0)
WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available.
You should consider upgrading via the '/data/data/com.termux/files/usr/bin/python3 -m pip install --upgrade pip' command.
√ ~λ
@BgilMidol oh its already there
you can import it then
and try it
well I can't import it
ModuleNotFoundError: No module named 'more_itertools'
15:06
huh
different python versions probavly
are you in a venv?
no
im in a project
python -m pip install more_itertools
requirement already satisfied
15:08
pip install --upgrade --force-reinstall more-itertools
you don't need more-itertools
list(itertools.chain.from_terable(some_list)) works
@BgilMidol use this implementation then:
only works on 2d lists
@BgilMidol ^ made by someone on tnb i forgot
15:21
actually I remember Bgil Midol making one too
@mathcat ?
in Poxuncla room
*P1A2E8L7
@mathcat not working
in P1A2E8L7 (Golfing language), Jan 22 at 16:26, by Bgil Midol
def flatten(items):
    """Yield items from any nested iterable; see Reference."""
    for x in items:
        if isinstance(x, Iterable) and not isinstance(x, (str, bytes)):
            for sub_x in flatten(x):
                yield sub_x
        else:
            yield x
(copied from stackoverflow)
how about:
def _interleave(a1, a2):
    """Interleave a1 and a2 (two iterables)"""

    a2 = itertools.cycle(a2)
    convert_func = "".join if isinstance(a1, str) else type(a1)
    return convert_func(itertools.chain.from_iterable(zip(a1, a2)))
15:28
why the underscore?
_interleave
(means it's private)
oh, ok
If you do that, you can't import it with from <name> import *
15:29
really?
didn't know that
@BgilMidol feedback?
nice
Also, I think IsType should have order.
no, that's what it's for
should probably have a better naming
15:46
@mathcat how about UnorderedTypecheck
yeah, something like that
actually, I'll improve it
How about a keyword-only argument for ordered and unordered type checking?
So it can be named typecheck()
hmm yeah
16:12
@mathcat implemented
pushing...
okay
push complete
I have a design idea
which may make things easier
What is it?
16:29
So, many functions in golfing languages won't have similar purposes, like in Vyxal * is multiply, repeat, and ring translate.
For example: If you make a multiply-like function for another element (which will happen a lot), you'd probably reuse the multiply function.
If you want to reuse ring-translate, (which is in the multiply function because they're the same element) in another element, the code will be hard to understand, because multiply and ring-translate are two different things packed in one function.
That was what I suggested, so yes.
oh right yes lol
Can I make it real quick, I can improve typecheck then too.
and would easy things like multiply be in a separate function?
Yes
It depends on how you define "easy", though
So how about like:
2 hours ago, by Bgil Midol
maybe a new file called function_helpers?
16:36
I'd say easy as things that are a single func/expression in python.
@BgilMidol nice
or element_helpers?
@mathcat yeah
also, do you think a1 a2 is better or is a b better?
a and b
16:54
brb
@BgilMidol Are you using python 3.10?
not sure
you can check with python -V
It says 3.6.8, but it's not.
(I'm sure.)
At least 3.9

« first day (33 days earlier)      last day (242 days later) »