|
5 | 5 | import numbers |
6 | 6 | import operator |
7 | 7 | import typing |
8 | | -import warnings |
9 | 8 | from collections.abc import Callable, Iterable, Mapping |
10 | 9 | from typing import Annotated, Any |
11 | 10 |
|
@@ -325,7 +324,7 @@ def analyze(self, bound_sig: inspect.BoundArguments) -> frozenset[Operation]: |
325 | 324 | The :func:`analyze` methods of :class:`Scoped` annotations that appear on |
326 | 325 | the signature of an :class:`Operation` are used by :func:`defop` to generate |
327 | 326 | implementations of :func:`Operation.__fvs_rule__` underlying alpha-renaming |
328 | | - in :func:`defterm` and :func:`defdata` and free variable sets in :func:`fvsof` . |
| 327 | + in :func:`evaluate` and :func:`defdata` and free variable sets in :func:`fvsof` . |
329 | 328 |
|
330 | 329 | Specifically, the :func:`analyze` method of the :class:`Scoped` annotation |
331 | 330 | of a parameter computes the set of bound variables in that parameter's value. |
@@ -419,28 +418,14 @@ def deffn[T, A, B]( |
419 | 418 |
|
420 | 419 | .. note:: |
421 | 420 |
|
422 | | - In general, avoid using :func:`deffn` directly. Instead, use |
423 | | - :func:`defterm` to convert a function to a term because it will |
424 | | - automatically create the right free variables. |
| 421 | + In general, avoid using :func:`deffn` directly. Instead, use :func:`trace` |
| 422 | + to convert a function to a term because it will automatically create the |
| 423 | + right free variables. |
425 | 424 |
|
426 | 425 | """ |
427 | 426 | raise NotHandled |
428 | 427 |
|
429 | 428 |
|
430 | | -@_CustomSingleDispatchCallable |
431 | | -def defterm[T](__dispatch: Callable[[type], Callable[[T], Expr[T]]], value: T): |
432 | | - """Convert a value to a term, using the type of the value to dispatch. |
433 | | -
|
434 | | - :param value: The value to convert. |
435 | | - :returns: A term. |
436 | | - """ |
437 | | - from effectful.ops.semantics import evaluate |
438 | | - |
439 | | - warnings.warn("defterm is replaced by evaluate", DeprecationWarning) |
440 | | - |
441 | | - return evaluate(value) |
442 | | - |
443 | | - |
444 | 429 | @_CustomSingleDispatchCallable |
445 | 430 | def defdata[T]( |
446 | 431 | __dispatch: Callable[[type], Callable[..., Expr[T]]], |
|
0 commit comments