src/basilisp/lang/runtime.py
def _fn_with_meta(f, meta: Optional[lmap.Map]):
    """Return a new function with the given meta. If the function f already
    has a meta map, then merge the """

    if not isinstance(meta, lmap.Map):
        raise TypeError("meta must be a map")

    if inspect.iscoroutinefunction(f):

        @functools.wraps(f)
        async def wrapped_f(*args, **kwargs):
            return await f(*args, **kwargs)

    else:

        @functools.wraps(f)  # type: ignore
        def wrapped_f(*args, **kwargs):
            return f(*args, **kwargs)

    wrapped_f.meta = (  # type: ignore
        f.meta.update(meta)
        if hasattr(f, "meta") and isinstance(f.meta, lmap.Map)
        else meta
    )
    wrapped_f.with_meta = partial(_fn_with_meta, wrapped_f)  # type: ignore
    return wrapped_f
def _fn_with_meta(f, meta: Optional[lmap.Map]):
    if not isinstance(meta, lmap.Map):
        raise TypeError("meta must be a map")

    if inspect.iscoroutinefunction(f):

        @functools.wraps(f)
        async def wrapped_f(*args, **kwargs):
            return await f(*args, **kwargs)

    else:

        @functools.wraps(f)  # type: ignore
        def wrapped_f(*args, **kwargs):
            return f(*args, **kwargs)

    wrapped_f.meta = (  # type: ignore
        f.meta.update(meta)
        if hasattr(f, "meta") and isinstance(f.meta, lmap.Map)
        else meta
    )
    wrapped_f.with_meta = partial(_fn_with_meta, wrapped_f)  # type: ignore
    return wrapped_f
def _fn_with_meta ( f , meta : Optional [ lmap . Map ] ) : if not isinstance ( meta , lmap . Map ) : raise TypeError ( "meta must be a map" ) if inspect . iscoroutinefunction ( f ) : @ functools . wraps ( f ) async def wrapped_f ( * args , * * kwargs ) : return await f ( * args , * * kwargs ) else : @ functools . wraps ( f ) # type: ignore def wrapped_f ( * args , * * kwargs ) : return f ( * args , * * kwargs ) wrapped_f . meta = ( # type: ignore f . meta . update ( meta ) if hasattr ( f , "meta" ) and isinstance ( f . meta , lmap . Map ) else meta ) wrapped_f . with_meta = partial ( _fn_with_meta , wrapped_f ) # type: ignore return wrapped_f
Return a new function with the given meta. If the function f already
    has a meta map, then merge the
Return a new function with the given meta . If the function f already has a meta map then merge the