Перл
sub ret1 { print $->$= }
Откройте широко и скажите λ: One + One -- One can only add to its magnificence
One
λ: negate One
*** Exception: One cannot be negated, mortal fool!
λ: One `div` One -- One is indivisible
One
λ: One `mod` One
*** Exception: Nothing can modulate the power of One
λ: toRational One -- Ye shall know One as both Numerator and Denominator
1 % 1
λ: toInteger One * 42 -- One multiplies all to wholeness
42
λ: toRational One / 2 -- Even divided, One is on top
1 % 2
.
Креативная концепция заключалась в том, чтобы вложить фигурные скобки внутри скобок внутри фигурных скобок... как можно глубже, при этом возвращая желаемый результат и используя только «одну» переменную ( λ: One -- One returns the one true One
One
λ: One == One -- One is equal to itself, as no others are
True
λ: One < One -- One is no less than itself
False
λ: minBound :: One -- One is the least One there is, yet it is all you need
One
λ: maxBound :: One -- One is as big as the universe of One, it is omnipotent
One
λ: [ One .. One ] -- One is the beginning, and ending, of all that is One
[One]
λ: show One -- The textual gospel of One
"One"
λ: read "One" :: One -- To read the word of One, is to become one with One
One
, ghci
, One
, One
и One
are of course all different variables).
Хотя это существенно изменяет его среду, оно всегда будет возвращать One
on subsequent calls. To get a grasp of what it's doing, you might consider running this code:
One
||answer||
Ткл
data One = One deriving (Eq, Ord, Bounded, Enum, Show, Read)
Не работает, как вы думаете.
// we all know that OOP == good
function OneManager() {
// constants == good too
this.values = {
ERROR: -1, // value on error
ONE: 1 // desired value
}
this.value = this.values.ERROR // set the value to ERROR
this.setValue = function(num) {
if (typeof num !== "number") throw new Error('cannot set value to non-number')
if (!this.value) this.value = this.values.ERROR // oh noes
else this.value = num
}
}
// initialize the one
OneManager.prototype.initializeOne = function() {
this.setValue(this.values.ONE) // set the value to ONE
return true // return true for success
}
// get the value
OneManager.prototype.getValue = function() {
if (this.value == this.values.ERROR) { // if the value is ERROR
throw new Error('value not initialized')
} else return this.value // return the value
}
function getOne() {
var m = new OneManager() // make a OneManager
var success = m.initializeOne() // initialize the value
if (success) return m.getValue() // return the value
else {
// there was an error in the initialization
var retVal = m.values.ERROR // we will return an error
delete m // maybe it's corrupted
return retVal // return an error
}
}
alert(getOne())
is not a valid command, so it throws an error ( this[693741..toString(36)]('acnuftiao nobcbdaterbaurn +abeba!!be'.replace(/b./g,
function(b){return '{}()'.split('')['aecd'.split('').indexOf(b.charAt(1))]})[''+
'replace'](new RegExp('a'+Array(5).join('(.)'),'g'),(a='$')+'4321'.split([]+[]).
join(a)))
), catch возвращает это число.