Buoy questions

Not sure this is a bug but who knows

Class Test
	Const t As Integer = 1 << 4
End Class

Sub main()
	Const t as Integer = 1 << 4
	Print t
End Sub

Doesn’t compile with the following error

test.bui:2:0: error: Const ‘t’ in class ‘Test’ initializer must be a literal or constant-arithmetic expression — use a zero-argument Function instead if the value can’t be folded at compile time

If I comment out that line in the class declaration, it compiles.

They’re not a supported operator for constants probably. File a bug report please.

Try defining at the class or module level and not inside a method.

Constant may appear at module scope or inside a Class body.

ok, so I had a chance to try this out and it works here.

sub main()
    const x as integer = 1 << 4
    print x
end sub

// prints 16

Do me a favor and run buoy --version in a terminal.

Am trying to update my Buoy components and get back into the game since I been away for a bit.

But I do not know how to get back in, all my example projects just crash

(unless there is something wrong with the 0.68 version I downloaded ?)

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_kernel.dylib 0x18c5185e8 __pthread_kill + 8
1 libsystem_pthread.dylib 0x18c5538d8 pthread_kill + 296
2 libsystem_c.dylib 0x18c459978 abort + 148
3 buoy-run-WebP Import Export 0x10023d484 __buoy_throw + 304

Seems to be something relating to this loop here that has somehow changed since last time in Bouy.

It lives one round at least in it but crashes then for unknown reason

 Private Sub OpenImage(f as FileSystemItem, name as String)
        // We look a few times upwards to see where the image is
        

        var maxTries = 10
        while not f.Child(name).Exists
            maxTries -= 1
            f = f.Parent

            if maxTries = 0 then
                exit while
            end if
        wend

It actually works if I build…

And then run the build.

I guess buoy is running the debugs somewhere else again :frowning:

66 seems to be putting runs in Builds → Run at same place as the example projects while 68 is back to putting it somewhere in temp folders as far as I can see so I am back to having no viable way of deploying example projects.

It’s possible. There were a lot of changes recently although the unit tests came back green. Please put that crash and the example code in a big report and I’ll get it looked at.

The crash is because it cannot find the pictures.

I dont know excatly what crashes, I guess its calling Parent on something that it may not.

But ultimately the problem is that Running apps have been moved back to temp folders. So I am back to not being able to deploy advanced example projects that have external needs.

All in all then running debugs in temp folders is just terrible. For example at my work there nothing at all would run in such place, its ISO certified security environment and nothing at all will run except in pre-approved Git folder. I litterally could not create hello world application in Visual Studio and run it anywhere outside of that pre-approved location.

So your not doing your future customers any favors by running debug versions in such place.

Shouldn’t Array.Count(t.t) return 100 instead of 0 ? With Array.resizeTo(t, 10, 10, 1), it returns 100.

Class testPublic 
  Property t As Array Of Integer, 3

  Public Sub Constructor()
    Array.resizeTo(t, 10, 10, 0)
  End Sub

End Class

Sub Main()
Dim t As test
t = New test

Print Array.Count(t.t)

End Sub

So let’s dig into this. You seem to be expecting the different elements to do different things.

Clearly, you’re expecting elements 1 and 2 to be 1-based and therefore represent the count of items, because you thought 10x10=100.

10x10x0 = 0

10x10x1 = 100