Recent

Author Topic: how to break out early of a case ?  (Read 55418 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 4212
Re: how to break out early of a case ?
« Reply #165 on: December 07, 2021, 01:53:23 pm »
Once we have support for compile time functions (the current term for them is “pure functions”) you can add that yourself ;)

:-) OTOH I'd suggest that that specific case might be worth examining whenever anybody complains that his desired initialisation can't be coded... I'm not suggesting that some implementation be added prematurely, only that it might turn out to be a common "pattern".

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

PascalDragon

  • Hero Member
  • *****
  • Posts: 4029
  • Compiler Developer
Re: how to break out early of a case ?
« Reply #166 on: December 07, 2021, 02:05:45 pm »
Once we have support for compile time functions (the current term for them is “pure functions”) you can add that yourself ;)

:-) OTOH I'd suggest that that specific case might be worth examining whenever anybody complains that his desired initialisation can't be coded... I'm not suggesting that some implementation be added prematurely, only that it might turn out to be a common "pattern".

No, it's not worth examining, because then the next one will come with the next function and so on. Better focus this into a more general approach.

Also if all you need is the size in bits then you can always use BitSizeOf.

MarkMLl

  • Hero Member
  • *****
  • Posts: 4212
Re: how to break out early of a case ?
« Reply #167 on: December 07, 2021, 02:07:48 pm »
No, it's not worth examining, because then the next one will come with the next function and so on. Better focus this into a more general approach.

Also if all you need is the size in bits then you can always use BitSizeOf.

I didn't mean examining as in "we'll add a function" but as in "if you did it like this you wouldn't be asking us to add a function" :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018