Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,4 @@
---
category:
- Simple
from: http://rosettacode.org/wiki/Operator_precedence

View file

@ -0,0 +1,8 @@
;Task:
Provide a list of   [[wp:order of operations|precedence]]   and   [[wp:operator associativity|associativity]]   of all the operators and constructs that the language utilizes in descending order of precedence such that an operator which is listed on some row will be evaluated prior to any operator that is listed on a row further below it.
Operators that are in the same cell (there may be several rows of operators listed in a cell) are evaluated with the same level of precedence, in the given direction.
State whether arguments are passed by value or by reference.
<br><br>

View file

@ -0,0 +1,5 @@
LDX #$02
LDY #$03
LDA ($20,x) ;uses the values stored at $20+x and $21+x as a memory address, and reads the byte at that address.
LDA ($20),y ;uses the values store at $20 and $21 as a memory address, and reads the byte at that address + Y.

View file

@ -0,0 +1,61 @@
# Operators are shown in decreasing order of precedence.
# A blank line separates groups of operators with equal precedence.
# All operators are left associative except:
# . assignment operators
# . conditional operator
# . exponentiation
# which are right associative.
#
# ( ) grouping
#
# $ field reference
#
# ++ increment (both prefix and postfix)
# -- decrement (both prefix and postfix)
#
# ^ exponentiation
# ** exponentiation (not all awk's)
#
# + unary plus
# - unary minus
# ! logical NOT
#
# * multiply
# / divide
# % modulus
#
# + add
# - subtract
#
# string concatenation has no explicit operator
#
# < relational: less than
# <= relational: less than or equal to
# > relational: greater than
# >= relational: greater than or equal to
# != relational: not equal to
# == relational: equal to
# > redirection: output to file
# >> redirection: append output to file
# | redirection: pipe
# |& redirection: coprocess (not all awk's)
#
# ~ regular expression: match
# !~ regular expression: negated match
#
# in array membership
#
# && logical AND
#
# || logical OR
#
# ?: conditional expression
#
# = assignment
# += addition assignment
# -= subtraction assignment
# *= multiplication assignment
# /= division assignment
# %= modulo assignment
# ^= exponentiation assignment
# **= exponentiation assignment (not all awk's)

View file

@ -0,0 +1,2 @@
print 2 + 3 * 5 ; same as 2 + (3 * 5)
print 3 * 5 + 2 ; same as 3 * (5 + 2)

View file

@ -0,0 +1 @@
3 * 2 + 1

View file

@ -0,0 +1 @@
3 * 2 -˜ 1

View file

@ -0,0 +1,2 @@
As with Common Lisp and Scheme, Lambdatalk uses s-expressions so there is no need for operator precedence.
Such an expression "1+2*3+4" is written {+ 1 {* 2 3} 4}

View file

@ -0,0 +1,2 @@
42 :my-var
42 "my-var" define

View file

@ -0,0 +1,7 @@
q)3*2+1
9
q)(3*2)+1 / Brackets give the usual order of precedence
7
q)x:5
q)(x+5; x:20; x-5)
25 20 0

View file

@ -0,0 +1 @@
(function arguments ...)

View file

@ -0,0 +1,21 @@
The next table present operators from higher precedence (Evaluated first) to lower precedence.
Operator
. [] () {}
- ~ :Literal [list items]
++ - -
Start:End
* / %
+ -
<< >>
&
| ^
< > <= >=
= !=
not
and or
Assignment = += -= *= /= %=>>= <<= &= ^= |=
Example:
See 3+5*4 # prints 23

View file

@ -0,0 +1 @@
$ syntax expr: .(). + .() is -> 7;

View file

@ -0,0 +1 @@
.(). + .()

View file

@ -0,0 +1 @@
1+2 * 3+4 # means: (1+2) * (3+4)

View file

@ -0,0 +1,7 @@
5 + b negated. "same as 5 + (b negated); unary > binary"
a abs - b sqrt "same as (a abs) - (b sqrt); unary > binary"
a bitAnd:1+a abs. "same as a bitAnd:(1+(a abs)); unary > binary > keyword"
(a bitAnd:1+a) bitOr:(b bitAnd:1+2 abs). "ditto"
"Beginners might be confused by:"
5 + a * b "same as (5 + a) * b; all binary; therefore left to right"