12 hours ago

On Friday, 12 September 2025 at 15:28:58 UTC, Monkyyy wrote:

>

On Friday, 12 September 2025 at 08:36:42 UTC, realhet wrote:

>

Hi,

import std;

[...]

It's seeing the eof of the mix file no?

This is the smallest example so far:

import std;

void main() {
  (   mixin("(()=>1)()")  ); //it compiles and runs.
    mixin("(()=>1)()")   ;  //Error: onlineapp.d-mixin-5(5): Error: found `End of File` when expecting `;` following expression
}

What I learned today is that the second mixin wants a statement and does not accept an expression. It didn't liked the EOF which is appeared at the end of the mixin text.

10 hours ago
On Fri, Sep 12, 2025 at 03:41:15PM +0000, realhet via Digitalmars-d-learn wrote:
> On Friday, 12 September 2025 at 15:28:58 UTC, Monkyyy wrote:
> > On Friday, 12 September 2025 at 08:36:42 UTC, realhet wrote:
> > > Hi,
> > > 
> > > ```d
> > > import std;
> > > 
> > > [...]
> > 
> > It's seeing the eof of the mix file no?
> 
> This is the smallest example so far:
> ```d
> import std;
> 
> void main() {
>   (   mixin("(()=>1)()")  ); //it compiles and runs.
>     mixin("(()=>1)()")   ;  //Error: onlineapp.d-mixin-5(5): Error: found
> `End of File` when expecting `;` following expression
> }
> ```
> 
> What I learned today is that the second mixin wants a statement and does not accept an expression. It didn't liked the EOF which is appeared at the end of the mixin text.

Add a semicolon at the end of the mixin string, and it should work.


T

-- 
If anyone wants a copy of Orthopedics Today, I have back issues.
1 2
Next ›   Last »