g.sandra.1995
Mitglied
Viele Internet Dienste convertieren eine Format in einer anderen z.B. von LateX 2 Html. Hat man eine Idee wie das programmiert ist? Mit etwa reguläre Ausdrucke?
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
ComFreek hat nur gemeint, dass die vollständige Portierung von einer Programmiersprache in eine andere ziemlich anstrengend (bis hin zu gar unmöglich) sein kann.meinst du in Java sehr schwer? wieso?
import math
import operator
def main():
fa_pow = function_array(math.pow, 10)
ca_pow = call_all(fa_pow)
fa_mul = function_array(operator.mul, 10)
ca_mul = call_all(fa_mul)
print(ca_pow(2))
print(ca_mul(2))
def partial(func, /, *args, **keywords):
""" STL function from module functools """
def newfunc(*fargs, **fkeywords):
newkeywords = {**keywords, **fkeywords}
return func(*args, *fargs, **newkeywords)
newfunc.func = func
newfunc.args = args
newfunc.keywords = keywords
return newfunc
def function_array(func, n):
return [partial(lambda a, b: func(b, a), i+1) for i in range(n)]
def call_all(function_array):
def newfunc(value):
return [f(value) for f in function_array]
return newfunc
if __name__ == '__main__':
main()
Das hier dürfte viel einfacher sein. Das sind beides im Prinzip nur Auszeichnungssprachen. (Ich weiß, LaTeX kann Turing-vollständig sein)z.B. von LateX 2 Html.