attr('action')) { $get = $_GET; if(isset($get['id'])) unset($get['id']); $self = wl($ID, $get, false, '&'); //attributes are escaped later $this->attr('action', $self); } // post is default if(!$this->attr('method')) { $this->attr('method', 'post'); } // we like UTF-8 if(!$this->attr('accept-charset')) { $this->attr('accept-charset', 'utf-8'); } // add the security token by default if (!$unsafe) { $this->setHiddenField('sectok', getSecurityToken()); } // identify this as a new form based form in HTML $this->addClass('doku_form'); } /** * Sets a hidden field * * @param string $name * @param string $value * @return $this */ public function setHiddenField($name, $value) { $this->hidden[$name] = $value; return $this; } #region element query function /** * Returns the numbers of elements in the form * * @return int */ public function elementCount() { return count($this->elements); } /** * Get the position of the element in the form or false if it is not in the form * * Warning: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function. * * @param Element $element * * @return false|int */ public function getElementPosition(Element $element) { return array_search($element, $this->elements, true); } /** * Returns a reference to the element at a position. * A position out-of-bounds will return either the * first (underflow) or last (overflow) element. * * @param int $pos * @return Element */ public function getElementAt($pos) { if($pos < 0) $pos = count($this->elements) + $pos; if($pos < 0) $pos = 0; if($pos >= count($this->elements)) $pos = count($this->elements) - 1; return $this->elements[$pos]; } /** * Gets the position of the first of a type of element * * @param string $type Element type to look for. * @param int $offset search from this position onward * @return false|int position of element if found, otherwise false */ public function findPositionByType($type, $offset = 0) { $len = $this->elementCount(); for($pos = $offset; $pos < $len; $pos++) { if($this->elements[$pos]->getType() == $type) { return $pos; } } return false; } /** * Gets the position of the first element matching the attribute * * @param string $name Name of the attribute * @param string $value Value the attribute should have * @param int $offset search from this position onward * @return false|int position of element if found, otherwise false */ public function findPositionByAttribute($name, $value, $offset = 0) { $len = $this->elementCount(); for($pos = $offset; $pos < $len; $pos++) { if($this->elements[$pos]->attr($name) == $value) { return $pos; } } return false; } #endregion #region Element positioning functions /** * Adds or inserts an element to the form * * @param Ele
# bug #1023

discard """
  output: "1 == 1"
"""

type Quadruple = tuple[a, b, c, d: int]

proc `+`(s, t: Quadruple): Quadruple =
  (a: s.a + t.a, b: s.b + t.b, c: s.c + t.c, d: s.d + t.d)

const
  A = (a: 0</