Skip to content

Commit

Permalink
Update prelude
Browse files Browse the repository at this point in the history
  • Loading branch information
StavromulaBeta committed Sep 12, 2024
1 parent dbdb954 commit 026c987
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/prelude.cog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
~
Compares two values and returns True if they differ.

```
Print != 1 2;
Print != 1 1;
```
~
Def != as ( Not == );

~
Expand Down Expand Up @@ -470,12 +478,10 @@ Def Index (
Let L;

When < 0 N ( Error Join "Invalid index " Show N );
When Empty? L ( Error "Index is beyond the end" );

Do If Zero? N ( return First element of L )
else (
When Empty? L ( Error "Index is beyond the end" );
Index - 1 N of Rest of L
);
else ( Index - 1 N of Rest of L )
);

~
Expand Down
2 changes: 1 addition & 1 deletion src/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -2515,7 +2515,7 @@ static TABLE ___remove(ANY key, TABLE T)
{
long llevel = T2->left->level;
long rlevel = T2->right->level;
long should_be = 1 + llevel < rlevel ? llevel : rlevel;
long should_be = 1 + (llevel < rlevel ? llevel : rlevel);

if (should_be < T2->level)
{
Expand Down

0 comments on commit 026c987

Please sign in to comment.