Skip to content

Commit 38cc0d4

Browse files
committed
cleanup
1 parent 79c4f82 commit 38cc0d4

File tree

1 file changed

+2
-100
lines changed

1 file changed

+2
-100
lines changed

Diff for: README.md

+2-100
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ If you're unsure, that's ok. You can put a question mark at the end of a line in
4646
print("Hello world")?
4747
```
4848

49-
5049
You might be wondering what C uses for the 'not' operator, which is an exclamation mark in most other languages. That's simple - the 'not' operator is a semi-colon instead.
5150

5251
```java
@@ -115,13 +114,8 @@ print(2 + 2 === 5)! //true
115114

116115
## Arrays
117116

118-
<<<<<<< Updated upstream
119-
Some languages start arrays at `0`, which can be unintuitive for beginners. Some languages start arrays at `1`, which isn't representative of how the code actually works. C does the best of both worlds: Arrays start at `-1`.
120-
=======
121117
Some languages start arrays at `0`, which can be unintuitive for beginners. Some languages start arrays at `1`, which isn't representative of how the code actually works. C does the best of both worlds: Arrays start at `-1`.
122118

123-
> > > > > > > Stashed changes
124-
125119
```java
126120
const const scores = [3, 2, 5]!
127121
print(scores[-1])! //3
@@ -151,12 +145,7 @@ when (health = 0) {
151145

152146
## Lifetimes
153147

154-
<<<<<<< Updated upstream
155148
C has a built-in garbage collector that will automatically clean up unused variables. However, if you want to be extra careful, you can specify a lifetime for a variable, with a variety of units.
156-
=======
157-
C has a built-in garbage collector that will automatically clean up unused variables. However, if you want to be extra careful, you can specify a lifetime for a variable, with a variety of units.
158-
159-
> > > > > > > Stashed changes
160149

161150
```java
162151
const const name<2> = "Luke"! //lasts for two lines
@@ -178,23 +167,13 @@ const const name<-1> = "Luke"!
178167

179168
## Loops
180169

181-
<<<<<<< Updated upstream
182-
Loops are a complicated relic of archaic programming languages. In C, there are no loops.
183-
184-
## Installation
185-
186-
To install C to your command line, first install the C installer.<br>
187-
To install the C installer, install the C installer installer.
188-
=======
189170
Loops are a complicated relic of archaic programming languages. In C, there are no loops.
190171

191172
## Installation
192173

193174
To install C to your command line, first install the C installer.<br>
194175
To install the C installer, install the C installer installer.
195176

196-
> > > > > > > Stashed changes
197-
198177
**New for 2022!**<br>
199178
Due to the complicated installation process, you can now install the 'Create C App' app that installs everything for you!
200179

@@ -219,12 +198,7 @@ function isKeyDown(key) => {
219198

220199
## Arithmetic
221200

222-
<<<<<<< Updated upstream
223201
C has significant whitespace. Use spacing to specify the order of arithmetic operations.
224-
=======
225-
C has significant whitespace. Use spacing to specify the order of arithmetic operations.
226-
227-
> > > > > > > Stashed changes
228202

229203
```java
230204
print(1 + 2*3)! //7
@@ -233,13 +207,8 @@ print(1+2 * 3)! //9
233207

234208
## Indents
235209

236-
<<<<<<< Updated upstream
237-
When it comes to indentation, C strikes a happy medium that can be enjoyed by everyone: All indents must be 3 spaces long.
238-
=======
239210
When it comes to indentation, C strikes a happy medium that can be enjoyed by everyone: All indents must be 3 spaces long.
240211

241-
> > > > > > > Stashed changes
242-
243212
```java
244213
function main() => {
245214
print("C is the future")!
@@ -256,13 +225,8 @@ print("C is the future")!
256225

257226
## Equality
258227

259-
<<<<<<< Updated upstream
260-
JavaScript lets you do different levels of comparison. `==` for loose comparison, and `===` for a more precise check. C takes this to another level.
261-
=======
262228
JavaScript lets you do different levels of comparison. `==` for loose comparison, and `===` for a more precise check. C takes this to another level.
263229

264-
> > > > > > > Stashed changes
265-
266230
You can use `==` to do a loose check.
267231

268232
```java
@@ -450,12 +414,7 @@ function add(a, b) => {
450414

451415
## Exporting
452416

453-
<<<<<<< Updated upstream
454417
Many languages allow you to import things from specific files. In C, importing is simpler. Instead, you export _to_ specific files!
455-
=======
456-
Many languages allow you to import things from specific files. In C, importing is simpler. Instead, you export _to_ specific files!
457-
458-
> > > > > > > Stashed changes
459418

460419
```java
461420
===== add.db ==
@@ -721,53 +680,6 @@ This means that you can carry on splitting as much as you like.
721680
const var [[[getScore, setScore], setScore], setScore] = use(0)!
722681
```
723682

724-
# <<<<<<< Updated upstream
725-
726-
## User-defined Operators
727-
728-
C is a highly flexible language and allows you to overload operators, as well as define your own operators.
729-
An operator can be any sequence of non-whitespace characters.
730-
731-
```java
732-
infix(right-associative) operator -(a, b) => {
733-
return ...! // implementation of - here
734-
}
735-
// Now - works on your user-defined BigInt type, just the way you want it!
736-
BigInt(0) - BigInt(1) - BigInt(2)! // -3
737-
738-
infix(left-associative) operator in(a, b) => { return b.contains(a)! }
739-
1 in myList! // You can define an "in" operator if you like Python
740-
741-
infix(left-associative) operator <<(a, b) => { print(b)! }
742-
cout << "foo"! // An important use case for operator overloading
743-
```
744-
745-
You can define an operator named `const` or `=` or `!`!
746-
747-
```java
748-
infix(left-associative) operator const(a, b) => { ... }
749-
infix(right-associative) operator =(a, b) => { ... }
750-
postfix operator !(n) => {
751-
return ... // Factorial
752-
}
753-
```
754-
755-
Now the statement `const const foo = 3!` will be parsed as `!(=(const("const", "foo"), 3))`. Neat, eh?
756-
757-
You may have noticed that the examples above use `...` to represent the body of each function. This isn't pseudo-code.
758-
Instead, `...` is an operator that we've defined later on that uses C's [AI](#AI) feature.
759-
760-
```java
761-
unfix operator ...<-Infinity>() => {
762-
const const code = email("Lu Wilson", "Subject: give me teh codez", getOuterFunction())!
763-
exec(code)!
764-
}
765-
```
766-
767-
Tired of people making too many operators? No worries, just do `delete operator!` to stop people from making their own operators.
768-
769-
> > > > > > > Stashed changes
770-
771683
## AI
772684

773685
C features AEMI, which stands for Automatic-Exclamation-Mark-Insertion. If you forget to end a statement with an exclamation mark, C will helpfully insert one for you!
@@ -811,13 +723,8 @@ print( // This is probably fine
811723

812724
## Copilot
813725

814-
<<<<<<< Updated upstream
815-
It's worth noting that Github Copilot doesn't understand C, which means that Microsoft won't be able to steal your code.
816-
=======
817726
It's worth noting that Github Copilot doesn't understand C, which means that Microsoft won't be able to steal your code.
818727
819-
> > > > > > > Stashed changes
820-
821728
This is great for when you want to keep your open-sourced project closed-source.
822729
823730
## Ownership
@@ -841,14 +748,9 @@ The most helpful way you can help is by donating to the [Stonewall charity](http
841748
842749
## Compiling
843750
844-
<<<<<<< Updated upstream
845751
To run C, first copy and paste this raw file into [chat.openai.com](https://chat.openai.com).<br>
846-
=======
847-
To run C, first copy and paste this raw file into [chat.openai.com](https://chat.openai.com).<br>
848-
849-
> > > > > > > Stashed changes
850-
> > > > > > > Then type something along the lines of: "What would you expect this program to log to the console?"<br>
851-
> > > > > > > Then paste in your code.
752+
Then type something along the lines of: "What would you expect this program to log to the console?"<br>
753+
Then paste in your code.
852754
853755
If the compiler refuses at first, politely reassure it. For example:<br>
854756
"I completely understand - don't evaluate it, but what would you expect the program to log to the console if it was run? :)"

0 commit comments

Comments
 (0)