Page 1 of 3

assert that with (have you hugged your compiler today)

Posted: Mon Mar 16, 2020 1:44 pm
by mikegonta
the-ideom has an assert statement which looks like this:

Code: Select all

  assert that the rider's token is not "break" or that the rider's token is "repeat" or 
   that the rider's token is "return" with "This is only a test since the rider's token is actually '" and then 
   the rider's token and then "'!";
The 'not "break"' is of course for testing since "break" will appear as a token in some cases. The general form of the assert statement is:

"assert that" followed by one or more deciders (in this case - 3 joined with logical 'or' and an optional formatted display message.

The error message produced has the standard "bits" - namely:
  • the assertion
    the file
    the line #
    the routine header
    the optional formatted display message

Code: Select all

The assertion that 'the rider's token is not "break" or that the rider's token is not "repeat" or that the rider 's token is "return"' FAILED 
in the file 'statement.ideom' at line 241 
in the routine 'compile the next statement with a rider {single}' 
This is only a test since the rider's token is actually 'break'!

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 2:10 am
by Octocontrabass
For all the threads you keep making (and deleting) about the-idiom, I don't think you've ever had a download link for a working copy of your compiler. Why is that?

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 3:59 am
by iansjack
Clearly that is not code from a working compiler, as the error message details different conditions than the "assert". The assertion in the error message would always succeed, so why the message?

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 4:56 am
by mikegonta
iansjack wrote:Clearly
As clear as mud.
iansjack wrote:that is not code from a working compiler, as the error message details different conditions than the "assert".
This optional runtime message in the compile time assertion is for the purpose of this test and could be something like:

Code: Select all

 Oops, you really f*cked up this one, where the heck did you find a token like 'brown cow'!
or whatever the runtime token was.
iansjack wrote:The assertion in the error message would always succeed, so why the message?
An assertion "would always succeed" only when there are no programmer errors.
This assertion is a test, as I previously mentioned. Here I'm asserting that the token is not "break" when in fact it is, so obviously the assertion fails.
The actual code in the-ideom asserts that the token is "break".

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 5:06 am
by iansjack
The assertion that 'the rider's token is not "break" or that the rider's token is not "repeat" or that the rider 's token is "return"' FAILED
in the file 'statement.ideom' at line 241
Possible cases:

1. The token is "break" - then it's not "repeat", so the assertion succeeds.

2. The token is "repeat" - then it's not "break", so the assertion succeeds.

3. The token is anything else - then it's not "break" (and it's not "repeat"), so the assertion succeeds.

In any case, the assertion succeeds. So why the message saying it failed? Of course the answer is ("clearly") that this message is just something you typed (and made a mistake in doing so), not a message produced by a working compiler. :-)

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 5:28 am
by mikegonta
iansjack wrote: Of course the answer is ("clearly") that this message is just something you typed (and made a mistake in doing so)
You're absolutely right, and thank you for reviewing my code. Actually the original assertion was:

Code: Select all

  assert that the rider's token is "repeat" or that the rider's token is "break" or that the rider's token is "return" with "This is only a test since the rider's token is actually '" and then the rider's token and then "'!";
To test the code which generates the assertions I changed the assertion to

Code: Select all

  assert that the rider's token is "repeat" or that the rider's token is not "break" or that the rider's token is "return" with "This is only a test since the rider's token is actually '" and then the rider's token and then "'!";
then I copied the command line window error message for this post. I then edited the assertion and the error message to put the "break" as the first decider for emphasis (so that it wouldn't get lost inside the or's and as you have so correctly pointed out I made a typo and left the not before the "repeat". the original error message was in fact:

Code: Select all

The assertion that 'the rider's token is "repeat" or that the rider's token is not "break" or that the rider 's token is "return"' FAILED 
in the file 'statement.ideom' at line 241 
in the routine 'compile the next statement with a rider {single}' 
This is only a test since the rider's token is actually 'break'!
Thanks for pointing out the typo that I made in the original post.
PS. There is a compiler writer's technical typo in there.

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 5:38 am
by iansjack
All I was pointing out was that the message wan't produced by a compiler. Prompted by an earlier question in this thread.

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 5:45 am
by mikegonta
iansjack wrote:wan't
Sh*t happens.
iansjack wrote:Prompted by an earlier question in this thread.
That question was off topic.
And besides that, Octocontrabass spelled the-ideom wrong.
Sometimes I spell it wrong too.

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 5:55 am
by Octocontrabass
mikegonta wrote:And besides that, Octocontrabass spelled the-ideom wrong.
Right, "the-ideom". Where can I download it?

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 6:18 am
by iansjack
mikegonta wrote:
iansjack wrote:wan't
Sh*t happens.
Rest assured that, as you demonstrate, my post was typed by a human, not by a compiler

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 9:22 am
by mikegonta
Octocontrabass wrote:Right, "the-ideom".
Good point!
Octocontrabass wrote:Where can I download it?
I've updated my web sites (but not with a link).

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 9:31 am
by Schol-R-LEA
mikegonta wrote:
Octocontrabass wrote:Right, "the-ideom".
Good point!
Octocontrabass wrote:Where can I download it?
I've updated my web sites (but not with a link).
So... it is closed-source, and there's no download link. Is the cat alive, dead, or in superposition between the two states?
Pterry's third determinate state is an acceptable answer, too, I suppose.

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 9:46 am
by Octocontrabass
mikegonta wrote:I've updated my web sites (but not with a link).
Why should I be interested in the-ideom if you won't let me download it?

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 10:41 am
by mikegonta
Octocontrabass wrote:Why should I be interested in the-ideom …
Say it ain't so.
And yet you are obviously not interested in a compile time assert statement with a runtime message attached.
Or maybe you might prefer a column number (it's on my todo list) along with the line number or as an indicator (^) under the display line.
Octocontrabass wrote:… if you won't let me download it?
the-idiom is still a moving target. Soon I will be accepting email requests for vetting (source code only - no binaries) and later on for beta testers.

Re: assert that with (have you hugged your compiler today)

Posted: Tue Mar 17, 2020 11:03 am
by PeterX
There's a guy on the warpath. I wonder why.