You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can create any operator that is made of any combination of one or more of `'+', '-', '/', '*', '|', '<', '>', '=', '!', '$', '@', '&'`
262
233
263
234
Most of the commonly defined operators like `+`, `<=`, etc are already implemented by the [stdlib](https://github.com/Champii/Rock/tree/master/std) that is automaticaly compiled with every package.
264
-
There is a `--nostd` option to allow you to use your own custom implementation.
235
+
There is a `--nostd` option to allow you to use your own custom implementation.
265
236
266
-
### Trait Definition
237
+
### Trait definition
267
238
268
239
This `trait ToString` is redondant with the `trait Show` implemented in the stdlib, and serves as a demonstration only
269
240
@@ -284,12 +255,7 @@ main =
284
255
```
285
256
286
257
```sh
287
-
rock run
288
-
```
289
-
290
-
Prints:
291
-
292
-
```sh
258
+
$ rock run
293
259
33
294
260
42.42
295
261
```
@@ -314,15 +280,13 @@ main =
314
280
```
315
281
316
282
```sh
317
-
rock run
283
+
$ rock run
284
+
1
318
285
```
319
286
320
-
Prints `1`
321
-
322
-
323
287
### Show implementation
324
288
325
-
```haskell
289
+
```haskell
326
290
struct Player
327
291
level::Int64
328
292
name::String
@@ -340,12 +304,11 @@ main =
340
304
```
341
305
342
306
```sh
343
-
rock run
307
+
$ rock run
308
+
MyName
344
309
```
345
310
346
-
Prints `MyName`
347
-
348
-
### Modules and Code Separation
311
+
### Modules and code separation
349
312
350
313
-`./myproj/src/foo.rk`
351
314
@@ -363,12 +326,15 @@ use foo::bar
363
326
main =print bar 1
364
327
```
365
328
366
-
Prints `2`
329
+
```sh
330
+
$ rock run
331
+
2
332
+
```
367
333
368
334
Note that we could have skiped the
369
335
`use foo::bar`
370
336
if we wrote
371
-
`main = print foo::bar 1`
337
+
`main = print foo::bar 1`
372
338
373
339
## REPL
374
340
@@ -381,7 +347,7 @@ This includes I/O of all sorts (Looking at you, open/read/write in loops)
381
347
Note that the REPL expects to be run from the project root, and expects some version of the stdlib
0 commit comments