diff --git a/classad/_expression.py b/classad/_expression.py
index 7885788..11647b1 100644
--- a/classad/_expression.py
+++ b/classad/_expression.py
@@ -232,18 +232,21 @@ class AttributeExpression(CompoundExpression):
             the_key = scope_up(self._expression[1])
             expression = self._expression[1][-1]
         elif self._expression[0] == "target":
-            if my is None or target is None:
+            if target is None:
                 return Undefined()
             selected_classad = target
             expression = self._expression[1]
         elif self._expression[0] == "my":
-            if my is None or target is None:
+            if my is None:
                 return Undefined()
-            expression = self._expression
+            expression = self._expression[1]
         else:
             expression = self._expression
         try:
-            context = find_scope(the_key, classad=selected_classad)
+            if the_key is None and selected_classad is not None:
+                context = selected_classad
+            else:
+                context = find_scope(the_key, classad=selected_classad)
         except TypeError:
             return Error()
         while isinstance(value, Undefined):
diff --git a/classad/_primitives.py b/classad/_primitives.py
index 6709e61..166ea71 100644
--- a/classad/_primitives.py
+++ b/classad/_primitives.py
@@ -63,9 +63,6 @@ class Undefined(PrimitiveExpression):
     def __repr__(self):
         return f"<{self.__class__.__name__}>"
 
-    def __hash__(self):
-        return hash("undefined")
-
 
 class Error(PrimitiveExpression):
     """
@@ -118,9 +115,6 @@ class Error(PrimitiveExpression):
     def __repr__(self):
         return f"<{self.__class__.__name__}>"
 
-    def __hash__(self):
-        return hash("error")
-
 
 class HTCInt(int, PrimitiveExpression):
     __slots__ = ()
@@ -229,9 +223,6 @@ class HTCInt(int, PrimitiveExpression):
     def __repr__(self):
         return f"<{self.__class__.__name__}>: {self}"
 
-    def __hash__(self):
-        return super().__hash__()
-
 
 class HTCList(tuple, PrimitiveExpression):
     __slots__ = ()
@@ -277,9 +268,6 @@ class HTCStr(str, PrimitiveExpression):
     def __repr__(self):
         return f"<{self.__class__.__name__}>: {self}"
 
-    def __hash__(self):
-        return super().__hash__()
-
 
 class HTCFloat(float, PrimitiveExpression):
     __slots__ = ()
@@ -326,9 +314,6 @@ class HTCFloat(float, PrimitiveExpression):
     def __repr__(self):
         return f"<{self.__class__.__name__}>: {self}"
 
-    def __hash__(self):
-        return super().__hash__()
-
 
 class HTCBool(PrimitiveExpression):
     __slots__ = ("_value",)
@@ -392,6 +377,3 @@ class HTCBool(PrimitiveExpression):
 
     def __repr__(self):
         return f"<{self.__class__.__name__}>: {self._value}"
-
-    def __hash__(self):
-        return hash(self._value)
diff --git a/docs/source/change/16.primitive_hash.yaml b/docs/source/change/16.primitive_hash.yaml
deleted file mode 100644
index 2528330..0000000
--- a/docs/source/change/16.primitive_hash.yaml
+++ /dev/null
@@ -1,7 +0,0 @@
-category: added
-summary: "Primitives now implement __hash__"
-description: |
-  So far, the primitives including `Undefined`, `Error`, `HTCInt`, `HTCFloat`,
-  `HTCBool` and `HTCStr` did not implement `__hash__`. This was added.
-pull requests:
-  - 16
diff --git a/docs/source/change/18.expression_evaluation.yaml b/docs/source/change/18.expression_evaluation.yaml
new file mode 100644
index 0000000..3507d6c
--- /dev/null
+++ b/docs/source/change/18.expression_evaluation.yaml
@@ -0,0 +1,8 @@
+category: added
+summary: "Evaluation of expression in context of classad"
+description: |
+  The project can now evaluate an expression in the context of a classads.
+issues:
+  - 17
+pull requests:
+  - 18

Evaluation of ArithmetricExpression in context of ClassAd not working
There still seems to be an issue when evaluating an ArithmetricExpression in the context of a ClassAd, e.g.

`parse("my.a + 2").evluate(my=parse("a=4")))`

This should result in a value of `6`.
diff --git a/classad_tests/test_builtins.py b/classad_tests/test_builtins.py
index de2b57d..9ed21d0 100644
--- a/classad_tests/test_builtins.py
+++ b/classad_tests/test_builtins.py
@@ -8,8 +8,8 @@ from classad._primitives import (
     HTCInt,
     HTCFloat,
     # HTCList,
+    # HTCStr,
     HTCBool,
-    HTCStr,
 )
 from classad._operator import eq_operator, ne_operator
 
@@ -60,17 +60,3 @@ def test_numbers(num_type):
             assert_similar(operation, HTCBool(False), num_type, value)
             assert_similar(operation, Error(), num_type, value)
             assert_similar(operation, Undefined(), num_type, value)
-
-
-def test_hashable():
-    test = set()
-    try:
-        test.add(Undefined())
-        test.add(Error())
-        test.add(HTCInt(1))
-        test.add(HTCFloat(0.0))
-        test.add(HTCStr("test"))
-        test.add(HTCBool(True))
-    except TypeError:
-        pytest.fail("Hashing not supported")
-    assert len(test) == 6
diff --git a/classad_tests/test_evaluation.py b/classad_tests/test_evaluation.py
new file mode 100644
index 0000000..17bbd9b
--- /dev/null
+++ b/classad_tests/test_evaluation.py
@@ -0,0 +1,8 @@
+from classad import parse
+from classad._primitives import HTCInt
+
+
+def test_simple():
+    first_part = parse("my.a + 2")
+    my_classad = parse("a = 4")
+    assert first_part.evaluate(my=my_classad) == HTCInt(6)

pip install -e .[dev]
parse_log_pytest
pytest
pytest
apt-get update apt-get install -y gcc
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs @ file:///croot/attrs_1668696182826/work
certifi @ file:///croot/certifi_1671487769961/work/certifi
cfgv==3.3.1
-e git+https://github.com/MaineKuehn/classad.git@0c6eb225e0bac00ff1136b57d340c32fa3637bbc#egg=classad
distlib==0.3.9
filelock==3.12.2
flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core
identify==2.5.24
importlib-metadata==6.7.0
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
nodeenv==1.9.1
packaging @ file:///croot/packaging_1671697413597/work
platformdirs==4.0.0
pluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work
pre-commit==2.21.0
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing==3.1.4
pytest==7.1.2
PyYAML==6.0.1
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
typing_extensions==4.7.1
virtualenv==20.26.6
zipp @ file:///croot/zipp_1672387121353/work

name: classad
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=22.1.0=py37h06a4308_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - flit-core=3.6.0=pyhd3eb1b0_0
  - importlib_metadata=4.11.3=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=22.0=py37h06a4308_0
  - pip=22.3.1=py37h06a4308_0
  - pluggy=1.0.0=py37h06a4308_1
  - py=1.11.0=pyhd3eb1b0_0
  - pytest=7.1.2=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py37h06a4308_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.11.0=py37h06a4308_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cfgv==3.3.1
      - classad==0.2.0
      - distlib==0.3.9
      - filelock==3.12.2
      - identify==2.5.24
      - importlib-metadata==6.7.0
      - nodeenv==1.9.1
      - platformdirs==4.0.0
      - pre-commit==2.21.0
      - pyparsing==3.1.4
      - pyyaml==6.0.1
      - typing-extensions==4.7.1
      - virtualenv==20.26.6
prefix: /opt/conda/envs/classad

classad_tests/test_evaluation.py::test_simple
classad_tests/test_builtins.py::test_numbers[HTCInt] classad_tests/test_builtins.py::test_numbers[HTCFloat]
classad/_expression.py docs/source/change/18.expression_evaluation.yaml classad/_primitives.py docs/source/change/16.primitive_hash.yaml
classad/_expression.py docs/source/change/18.expression_evaluation.yaml classad/_primitives.py docs/source/change/16.primitive_hash.yaml