Re: Error when using `import`.

2024-02-24 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 24 February 2024 at 10:31:06 UTC, Liam McGillivray wrote: `Unit.d` & `Map.d` are longer files. `Map.d` begins with `import Tile;`, and `Unit.d` begins with `import Map;`. Why are the errors happening? What's the problem? Why is it `currentclass.importedclass` instead of simply t

Re: Searching for i" in the forum

2024-02-24 Thread Lysander via Digitalmars-d-learn
On Friday, 23 February 2024 at 23:18:12 UTC, kdevel wrote: How do I search for i" in the forum? I get the following errors: i" -> Error: malformed MATCH expression: [i"] (1) i\" -> Error: malformed MATCH expression: [i\"] (1) 'i"' -> Error: malformed MATCH expression: ['i"'] (1)

Re: Error when using `import`.

2024-02-24 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 24/02/2024 11:51 PM, Liam McGillivray wrote: On Saturday, 24 February 2024 at 10:34:25 UTC, Richard (Rikki) Andrew Cattermole wrote: A few things. Module names should be lower case. I capitalised the first letter in the class names so that I can make instances of them in lowercase. Shou

Re: Error when using `import`.

2024-02-24 Thread Liam McGillivray via Digitalmars-d-learn
On Saturday, 24 February 2024 at 10:34:25 UTC, Richard (Rikki) Andrew Cattermole wrote: A few things. Module names should be lower case. I capitalised the first letter in the class names so that I can make instances of them in lowercase. Should I rename the classes, modules, and filenames to

Re: Error when using `import`.

2024-02-24 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
A few things. Module names should be lower case. Each file, needs the full module declaration. source/foo/bar.d: ```d module foo.bar; ``` source/app.d: ```d module app; import foo.bar; ``` Directories matter, this allows the import path search (via the use of the -I switch) to loca

Error when using `import`.

2024-02-24 Thread Liam McGillivray via Digitalmars-d-learn
I am trying to make a tactical role-playing game which I am likely to open-source. Right now the code is very simple, with only 3 files each containing a class with the same name. The files are `Map.d`, `Tile.d`, and `Unit.d`. Each of these files contains an `import` line to access one of the