* Denis Cheremisov [191026 06:09]:
> The answer was simple:
>
> var fset token.FileSet – wrong
>
> fset := token.NewFileSet() – right
I believe I am in the minority here, but I am not a singleton minority.
There are at least several of us who agree that «var» should be used
over «:=» whenever
On Saturday, October 26, 2019 at 10:22:42 PM UTC+2, atd...@gmail.com wrote:
>
>
> On Saturday, October 26, 2019 at 9:47:39 PM UTC+2, Ian Lance Taylor wrote:
>>
>> On Sat, Oct 26, 2019 at 10:50 AM atd...@gmail.com
>> wrote:
>> >
>> > I get that we can do that but it's not strictly about slices o
On Saturday, October 26, 2019 at 9:47:39 PM UTC+2, Ian Lance Taylor wrote:
>
> On Sat, Oct 26, 2019 at 10:50 AM atd...@gmail.com > wrote:
> >
> > I get that we can do that but it's not strictly about slices operations
> such as appending or copying.
> > Of course, we could copy slices all th
On Sat, Oct 26, 2019 at 10:50 AM atd...@gmail.com wrote:
>
> I get that we can do that but it's not strictly about slices operations such
> as appending or copying.
> Of course, we could copy slices all the time but then there is no benefit in
> having them and it is not ergonomic as your exampl
To add to this issue, that's a problem that is also related to how type
equality is treated in the spec and deep equality. If we have some kind of
"snapshot" slices for instance, an equality can be determined for these
(with some other things to consider) and for structs with fields that are
"s
I get that we can do that but it's not strictly about slices operations
such as appending or copying.
Of course, we could copy slices all the time but then there is no benefit
in having them and it is not ergonomic as your example shows, nor does it
fit your performance cost requirements.
If yo
Correct, so basically avoid x := y[i:j] if you actually meant copy
https://golang.org/ref/spec#Appending_and_copying_slices
var a = [...]int{0, 1, 2, 3, 4, 5, 6, 7}
var s = make([]int, 6)
var b = make([]byte, 5)
n1 := copy(s, a[0:])// n1 == 6, s == []int{0, 1, 2, 3, 4, 5}
n2 := copy(s
It could be done, Robert. Then the programs would run in every platform
that Go runs, quite a few!
On Saturday, October 26, 2019 at 12:34:21 PM UTC-3, Robert Engels wrote:
>
> Why not generate Go?
>
>
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" gr
Out of curiosity only.
> On Oct 26, 2019, at 10:33 AM, Robert Engels wrote:
>
>
> Why not generate Go?
>
>>> On Oct 26, 2019, at 9:40 AM, JuciÊ Andrade wrote:
>>>
>>
>> Feel free to classify the tool anyway you like, Anca.
>>
>> I don't buy the distinction between "compiler" and "transp
Why not generate Go?
> On Oct 26, 2019, at 9:40 AM, JuciÊ Andrade wrote:
>
>
> Feel free to classify the tool anyway you like, Anca.
>
> I don't buy the distinction between "compiler" and "transpiler" because it's
> the same thing. They read code in some language and generates code in some
Feel free to classify the tool anyway you like, Anca.
I don't buy the distinction between "compiler" and "transpiler" because
it's the same thing. They read code in some language and generates code in
some language.
I picked C for output because it is utterly portable and everyone could
enjoy
I just edited the project README to clarify this point. This tool generates
C code that you submits to the C compiler for your particular platform.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving
Ah so it is an transpiller:
https://en.wikipedia.org/wiki/Source-to-source_compiler
On Saturday, October 26, 2019 at 5:03:40 PM UTC+3, Robert Engels wrote:
>
> Yes. I generates C code from a basic program and you compile the C.
>
> On Oct 26, 2019, at 8:55 AM, Anca Emanuel > wrote:
>
>
> Plea
Yes. I generates C code from a basic program and you compile the C.
> On Oct 26, 2019, at 8:55 AM, Anca Emanuel wrote:
>
>
> Please explain how it works.
> Do you get executables from basic programs ?
>
>
>> On Saturday, October 26, 2019 at 4:40:43 PM UTC+3, JuciÊ Andrade wrote:
>> Hi, Anca
Please explain how it works.
Do you get executables from basic programs ?
On Saturday, October 26, 2019 at 4:40:43 PM UTC+3, JuciÊ Andrade wrote:
>
> Hi, Anca.
>
> The compiler proper doesn't use C code, generated code does, it has
> references to some support functions.
> Those support function
Hi, Anca.
The compiler proper doesn't use C code, generated code does, it has
references to some support functions.
Those support functions are declared in basiclib.h and defined in
basiclib.c .
On Saturday, October 26, 2019 at 10:32:24 AM UTC-3, Anca Emanuel wrote:
>
> Why do you need C in the
Why do you need C in the source code ?
On Saturday, October 26, 2019 at 3:16:40 PM UTC+3, JuciÊ Andrade wrote:
>
> https://github.com/jucie/basic
>
> A compiler for BASIC programming language.
>
>
> This tool understands what is in David H. Ahl's own words "the gold
> standard of microcomputer BA
Hi,
Thank you for the response.
My issue is not really about append but can be illustrated by this :
https://play.golang.org/p/YZlo1mqGDLz
On Saturday, October 26, 2019 at 2:27:06 PM UTC+2, Gert wrote:
>
> Sorry, the performance cost is to high. But you can practice a few
> programming habits
Sorry, the performance cost is to high. But you can practice a few
programming habits that can prevent this, like use x = append(x, y) and
never x = append(y, x) Basically we only need a Go proverb bible mentioned
in one of Rob Pike's talks and we will be fine :)
On Saturday, October 26, 2019 a
There is an important distinction:
- users of your project / library are interested in hard dependencies of it
- developers / testers of your library will actually be using its test
dependencies
Go modules enforces the first group your test dependencies as hard
dependencies, which is not right.
2
https://github.com/jucie/basic
A compiler for BASIC programming language.
This tool understands what is in David H. Ahl's own words "the gold
standard of microcomputer BASICs: MITS Altair 8K BASIC, Rev. 4.0 (ix)." It
has been tested against every program from Ahl's bestseller "BASIC Computer
Stuck :( I am lost in a jungle of source code looking for `Report` printers
On Saturday, October 26, 2019 at 1:33:29 PM UTC+2, Gert wrote:
>
> A no wait need to go other direction and find all type Pass structs
>
> pass.Report(Diagnostic{Pos: pos, Message: msg})
>
> On Saturday, October 26, 2019
Hello,
I've just realized that slices were much more delicate to use than
initially thought. The main issue is that when slices share the same
backing array, it is too easy to inadvertently have an unprotected
concurrent Read/Write if one is not careful.
That can easily happen for a struct tha
A no wait need to go other direction and find all type Pass structs
pass.Report(Diagnostic{Pos: pos, Message: msg})
On Saturday, October 26, 2019 at 1:23:40 PM UTC+2, Gert wrote:
>
>
> https://github.com/golang/tools/blob/master/go/analysis/analysis.go#L161-L173
>
> Can I assume every output of g
https://github.com/golang/tools/blob/master/go/analysis/analysis.go#L161-L173
Can I assume every output of go vet passes through here? So basically need
to figure out all the references to this two functions and change the
format?
On Saturday, October 26, 2019 at 12:59:59 PM UTC+2, Gert wrote:
https://github.com/golang/go/issues/24344#issuecomment-546589062
The start of the go vet rabbit hole is this right?
https://github.com/golang/go/blob/master/src/cmd/vet/main.go
So basically one of does or all of the analyzers is responsible for the
print output right?
So if i want to fix it i n
The answer was simple:
var fset token.FileSet – wrong
fset := token.NewFileSet() – right
вторник, 22 октября 2019 г., 11:20:38 UTC+3 пользователь Michel Levieux
написал:
>
> Hi Denis,
>
> In a project of my own I encountered the same issue. This program moves a
> go project to another locati
Hello!
chasquid v1.1 has been released.
chasquid is an SMTP (email) server with a focus on simplicity, security, and
ease of operation.
It's written in Go, and is open source under the Apache license 2.0.
See https://blitiri.com.ar/p/chasquid/ for more information.
The main changes in thi
This is behaving as documented. The docs say "keys of any string type are
used directly".
The reason for that behaviour is probably to avoid breaking backward
compatibility, because historically encoding/json did not recognise
TextMarshaler in map keys.
You could wrap your type in a struct:
t
29 matches
Mail list logo