7 deleted 111 characters in body
source | link

Common Lisp, 27 bytes

Tested on SBCL and ECL. For a portable approach, one should use trivial-features.

(lambda()'L #+big-endian'B)

The #+ notation is a read-time condition, that reads the next form only if the conditional expression evaluates to true. Here the condition is the whole #+big-endian text which means that the test is satisfied if the :big-endian keyword belongs to the *FEATURES* list (a list which contains among other things platform-specific information). The following expression is 'B, which is either read or skipped according to the outcome of the test. If your platform is big-endian and you write the above form in the REPL, it is exactly as if you wrote the following:

CL-USER>(lambda()'L 'B)

(NB.CL-USER> is the prompt)

A function's body is an implicit PROGN, meaning that only the evaluation of the last expression is returned. So the above actually returns symbol ̀B. If however the read-time condition evaluates to false, the form reads as if you wrote:

CL-USER>(lambda()'L)

... which simply returns symbol L.

Common Lisp, 27 bytes

Tested on SBCL and ECL.

(lambda()'L #+big-endian'B)

The #+ notation is a read-time condition, that reads the next form only if the conditional expression evaluates to true. Here the condition is the whole #+big-endian text which means that the test is satisfied if the :big-endian keyword belongs to the *FEATURES* list (a list which contains among other things platform-specific information). The following expression is 'B, which is either read or skipped according to the outcome of the test. If your platform is big-endian and you write the above form in the REPL, it is exactly as if you wrote the following:

CL-USER>(lambda()'L 'B)

(NB.CL-USER> is the prompt)

A function's body is an implicit PROGN, meaning that only the evaluation of the last expression is returned. So the above actually returns symbol ̀B. If however the read-time condition evaluates to false, the form reads as if you wrote:

CL-USER>(lambda()'L)

... which simply returns symbol L.

Common Lisp, 27 bytes

Tested on SBCL and ECL. For a portable approach, one should use trivial-features.

(lambda()'L #+big-endian'B)

The #+ notation is a read-time condition, that reads the next form only if the conditional expression evaluates to true. Here the condition is the whole #+big-endian text which means that the test is satisfied if the :big-endian keyword belongs to the *FEATURES* list (a list which contains among other things platform-specific information). The following expression is 'B, which is either read or skipped according to the outcome of the test. If your platform is big-endian and you write the above form in the REPL, it is exactly as if you wrote the following:

CL-USER>(lambda()'L 'B)

(NB.CL-USER> is the prompt)

A function's body is an implicit PROGN, meaning that only the evaluation of the last expression is returned. So the above actually returns symbol ̀B. If however the read-time condition evaluates to false, the form reads as if you wrote:

CL-USER>(lambda()'L)

... which simply returns symbol L.

6 deleted 111 characters in body
source | link

SBCL (Common Lisp), 21 17 27 bytes

Tested on SBCL and ECL.

(lambda()'L #+big-endian'B)

The #+ notation is a read-time condition, that reads the next form only if the conditional expression evaluates to true. Here the condition is the whole #+big-endian text which means that the test is satisfied if the :big-endian keyword belongs to the *FEATURES* list (a list which contains among other things platform-specific information). The following expression is 'B, which is either read or skipped according to the outcome of the test. If your platform is big-endian and you write the above form in the REPL, it is exactly as if you wrote the following:

CL-USER>'LUSER>(lambda()'L 'B)

(NB.CL-USER> is the prompt)

Fortunately, SBCL's REPL treats multiple forms entered in sequence like aA function's body is an implicit PROGN, meaning that only the evaluation of the last expression is returned and printed. So the above actually returns, and prints symbol ̀B. If however the read-time condition evaluates to false, the form reads as if you wrote:

CL-USER>'LUSER>(lambda()'L)

... which simply returns and prints symbol L.


Score is now 27 so that it is a function.

SBCL (Common Lisp), 21 17 27 bytes

(lambda()'L #+big-endian'B)

The #+ notation is a read-time condition, that reads the next form only if the conditional expression evaluates to true. Here the condition is the whole #+big-endian text which means that the test is satisfied if the :big-endian keyword belongs to the *FEATURES* list (a list which contains among other things platform-specific information). The following expression is 'B, which is either read or skipped according to the outcome of the test. If your platform is big-endian and you write the above form in the REPL, it is exactly as if you wrote the following:

CL-USER>'L 'B

(NB.CL-USER> is the prompt)

Fortunately, SBCL's REPL treats multiple forms entered in sequence like a PROGN, meaning that only the evaluation of the last expression is returned and printed. So the above actually returns, and prints symbol ̀B. If however the read-time condition evaluates to false, the form reads as if you wrote:

CL-USER>'L

... which simply returns and prints symbol L.


Score is now 27 so that it is a function.

Common Lisp, 27 bytes

Tested on SBCL and ECL.

(lambda()'L #+big-endian'B)

The #+ notation is a read-time condition, that reads the next form only if the conditional expression evaluates to true. Here the condition is the whole #+big-endian text which means that the test is satisfied if the :big-endian keyword belongs to the *FEATURES* list (a list which contains among other things platform-specific information). The following expression is 'B, which is either read or skipped according to the outcome of the test. If your platform is big-endian and you write the above form in the REPL, it is exactly as if you wrote the following:

CL-USER>(lambda()'L 'B)

(NB.CL-USER> is the prompt)

A function's body is an implicit PROGN, meaning that only the evaluation of the last expression is returned. So the above actually returns symbol ̀B. If however the read-time condition evaluates to false, the form reads as if you wrote:

CL-USER>(lambda()'L)

... which simply returns symbol L.

5 added 75 characters in body
source | link

SBCL (Common Lisp), 21 1717 27 bytes

(lambda()'L #+big-endian'B)

The #+ notation is a read-time condition, that reads the next form only if the conditional expression evaluates to true. Here the condition is the whole #+big-endian text which means that the test is satisfied if the :big-endian keyword belongs to the *FEATURES* list (a list which contains among other things platform-specific information). The following expression is 'B, which is either read or skipped according to the outcome of the test. If your platform is big-endian and you write the above form in the REPL, it is exactly as if you wrote the following:

CL-USER>'L 'B

(NB.CL-USER> is the prompt)

Fortunately, SBCL's REPL treats multiple forms entered in sequence like a PROGN, meaning that only the evaluation of the last expression is returned and printed. So the above actually returns, and prints symbol ̀B. If however the read-time condition evaluates to false, the form reads as if you wrote:

CL-USER>'L

... which simply returns and prints symbol L.


Score is now 27 so that it is a function.

SBCL (Common Lisp), 21 17 bytes

'L #+big-endian'B

The #+ notation is a read-time condition, that reads the next form only if the conditional expression evaluates to true. Here the condition is the whole #+big-endian text which means that the test is satisfied if the :big-endian keyword belongs to the *FEATURES* list (a list which contains among other things platform-specific information). The following expression is 'B, which is either read or skipped according to the outcome of the test. If your platform is big-endian and you write the above form in the REPL, it is exactly as if you wrote the following:

CL-USER>'L 'B

(NB.CL-USER> is the prompt)

Fortunately, SBCL's REPL treats multiple forms entered in sequence like a PROGN, meaning that only the evaluation of the last expression is returned and printed. So the above actually returns, and prints symbol ̀B. If however the read-time condition evaluates to false, the form reads as if you wrote:

CL-USER>'L

... which simply returns and prints symbol L.

SBCL (Common Lisp), 21 17 27 bytes

(lambda()'L #+big-endian'B)

The #+ notation is a read-time condition, that reads the next form only if the conditional expression evaluates to true. Here the condition is the whole #+big-endian text which means that the test is satisfied if the :big-endian keyword belongs to the *FEATURES* list (a list which contains among other things platform-specific information). The following expression is 'B, which is either read or skipped according to the outcome of the test. If your platform is big-endian and you write the above form in the REPL, it is exactly as if you wrote the following:

CL-USER>'L 'B

(NB.CL-USER> is the prompt)

Fortunately, SBCL's REPL treats multiple forms entered in sequence like a PROGN, meaning that only the evaluation of the last expression is returned and printed. So the above actually returns, and prints symbol ̀B. If however the read-time condition evaluates to false, the form reads as if you wrote:

CL-USER>'L

... which simply returns and prints symbol L.


Score is now 27 so that it is a function.

4 deleted 37 characters in body
source | link
3 added 425 characters in body
source | link
2 added 11 characters in body
source | link
1
source | link