<commit_before>using System;

namespace DynamicProperty {
    public class DynamicValue<T> : BasicValue<T> {
		public DynamicValue(Func<T> read, Action<T> write) {
			_read = read;
			_write = write;
		    using (Transaction.Instance(this))
		    { base.Set(_read()); }
        }
		//protected override T Get() {
		//	if (!Valid)
		//		Evaluate();
		//	return base.Get();
		//}
		protected override void Set(T value) {
			_write(value);
		}
		private void Evaluate() {
            CutDependency();
            base.Set(_read());
		}

        protected override void Eval(){
                Evaluate();
        }
		private readonly Func<T> _read;
		private readonly Action<T> _write;
	}<commit_msg>Transaction around _read<commit_after>using System;

namespace DynamicProperty {
    public class DynamicValue<T> : BasicValue<T> {
		public DynamicValue(Func<T> read, Action<T> write) {
			_read = read;
			_write = write;
		    using (Transaction.Instance(this))
		    { base.Set(_read()); }
        }
		//protected override T Get() {
		//	if (!Valid)
		//		Evaluate();
		//	return base.Get();
		//}
		protected override void Set(T value) {
			_write(value);
		}
		private void Evaluate() {
            CutDependency();
		    T result;
		    using (Transaction.Instance(this))
            { result = _read(); }
            base.Set(result);
		}

        protected override void Eval(){
            Evaluate();
        }
		private readonly Func<T> _read;
		private readonly Action<T> _write;
	}
{'fraction_non_alphanumeric': 0.1341381623071764, 'fraction_numerical': 0.0, 'mean_word_length': 2.3986332574031892, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6177367', 'n_tokens_mistral': 511, 'n_tokens_neox': 448, 'n_words': 114}