// src/framework/shadowlisp/primitives/SlTrue.ts
//
// Vision 49: Boolean true element - IS a Matrix component
//
// <sl-true/> evaluates to true.

import type { SExpr } from '../../../lisp/SExpr';
import { SlMatrixElement } from '../SlMatrixElement';

/**
 * SlTrue - Boolean true element that IS a Matrix component.
 *
 * @example
 * <sl-true/>   => true
 */
export class SlTrue extends SlMatrixElement {
  async evalSelf(_env: SExpr[]): Promise<SExpr> {
    return true;
  }

  toSExpr(): SExpr {
    return true;
  }
}

if (!customElements.get('sl-true')) {
  customElements.define('sl-true', SlTrue);
}
