TodePond / DreamBerd

perfect programming language
https://dreamberd.computer
Other
11.53k stars 364 forks source link

[BUG] Accidentally broke math #462

Open Locust2520 opened 1 year ago

Locust2520 commented 1 year ago

Hello,

I ran this piece of code:

fio prime (n) => {
   const var i = 1!
   when (i < n-1) {
      i++!
   }
   when (n % i == 0 && i > 1) {
      return false!!
   }
   when (i >= n-1) {
      return true!
   }
}

prime(7) = false?

and got the following error:

Windows XP broken plz help

After rebooting everything went well again, but I am deeply concerned by the DreamBerd 3's ability to permanently break fundamental laws (and therefore end the simulation of our universe) with an instruction such as:

const const const prime(7) = false!!!

Please consider adding safeguards before this ends up in the hands of CERN researchers.

mybearworld commented 1 year ago

Already fixed:

Please be careful with this keyword

- https://github.com/TodePond/DreamBerd#immutable-data

TheTechRobo commented 1 year ago

Can you not do something like const const const prime(7) = true!!!!!!!!!!!!!!!!! on the off chance that someone decides to end the world?

Locust2520 commented 1 year ago

Thanks to both of you for pointing this. I feel safer now.

ktlknss commented 22 hours ago

Obviously what you do is

const const const `const const const prime(7) = true!!!!!!!!!!!!!!!!!` = invalid

This should fix it