OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 10:59 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: assert that with (have you hugged your compiler today)
PostPosted: Mon Mar 16, 2020 1:44 pm 
Offline
Member
Member

Joined: Thu May 19, 2011 5:13 am
Posts: 228
the-ideom has an assert statement which looks like this:
Code:
  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:
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'!

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 2:10 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
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?


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 3:59 am 
Online
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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?


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 4:56 am 
Offline
Member
Member

Joined: Thu May 19, 2011 5:13 am
Posts: 228
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:
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".

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 5:06 am 
Online
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
Quote:
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. :-)


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 5:28 am 
Offline
Member
Member

Joined: Thu May 19, 2011 5:13 am
Posts: 228
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:
  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:
  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:
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.

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com


Last edited by mikegonta on Tue Mar 17, 2020 5:43 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 5:38 am 
Online
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
All I was pointing out was that the message wan't produced by a compiler. Prompted by an earlier question in this thread.


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 5:45 am 
Offline
Member
Member

Joined: Thu May 19, 2011 5:13 am
Posts: 228
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.

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 5:55 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
mikegonta wrote:
And besides that, Octocontrabass spelled the-ideom wrong.

Right, "the-ideom". Where can I download it?


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 6:18 am 
Online
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4591
Location: Chichester, UK
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


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 9:22 am 
Offline
Member
Member

Joined: Thu May 19, 2011 5:13 am
Posts: 228
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).

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 9:31 am 
Offline
Member
Member
User avatar

Joined: Fri Oct 27, 2006 9:42 am
Posts: 1925
Location: Athens, GA, USA
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.

_________________
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 9:46 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
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?


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 10:41 am 
Offline
Member
Member

Joined: Thu May 19, 2011 5:13 am
Posts: 228
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.

_________________
Mike Gonta
look and see - many look but few see

https://mikegonta.com


Top
 Profile  
 
 Post subject: Re: assert that with (have you hugged your compiler today)
PostPosted: Tue Mar 17, 2020 11:03 am 
Offline
Member
Member

Joined: Fri Nov 22, 2019 5:46 am
Posts: 590
There's a guy on the warpath. I wonder why.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 32 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group