Henrik Grubbström escribió/skribis/wrote/scrit (2025-03-14T14:32:56+0100):
> the error is triggered because the compiler has sufficient type
> information to determine that the respective calls will always fail.
It makes sense, yes. Thank you for the explanation.
--
Marcos Cruz
http://programa
Hi Marcos.
On Thu, 13 Mar 2025, Marcos Cruz wrote:
I'm using Pike v8.0 release 1738 on Debian 12.9.
I got this:
```
int x;
x = has_value(({ 1, 2, 3, 4 }), -100); // result: 0
x = has_value(({ 1, 2, 3, 4 }), 0); // result: 0
x = has_value(({ 1, 2, 3, 4 }), 4); // result: 1
x = has_value(({ 1,
Hmm. I’m not sure where I fall on this. I can appreciate that the haystack may
have a type and you might want to restrict the type over the operand in some
situations but it seems like a method like has_value should be lenient with
respect to the value being searched for.
Sent from my iPhone
On Fri, 14 Mar 2025 at 03:31, Marcos Cruz wrote:
> So somehow the problem happens when the array argument is a literal,
> both in hilfe and in a file.
When you use literals, yes, has_value expects that the argument makes
sense. But normally you'll be using a variable for one or both of its
argume
will...@welliver.org escribió/skribis/wrote/scrit (2025-03-13T12:16:36-0400):
> In the meantime, you can get around this error by using the following:
>
> > int x;
> > array y = ({ 1, 2, 3, 4 });
> > x = has_value(y, 5);
I know hilfe has some limitations, but the problem happens to me both in
hi
I'm using Pike v8.0 release 1738 on Debian 12.9.
I got this:
```
int x;
x = has_value(({ 1, 2, 3, 4 }), -100); // result: 0
x = has_value(({ 1, 2, 3, 4 }), 0); // result: 0
x = has_value(({ 1, 2, 3, 4 }), 4); // result: 1
x = has_value(({ 1, 2, 3, 4 }), 5);
Compiler Error: 1: Bad argument 2 to
Hi Marcos!
If you're using hilfe, you may occasionally notice that perfectly legal
code doesn't work. That's a result of the "magic" that makes incremental
compilation and evaluation in hilfe possible. I think this is one of
those occasions. I'm sure that someone with understanding of how hilf
On Tue, 19 Oct 2021 10:07:43 +1100
Chris Angelico wrote:
[snip]
> > set warnings strict
That worked swell in my Hilfe! Thx
--
Duke
On Tue, 19 Oct 2021 10:07:43 +1100
Chris Angelico wrote:
> On Tue, Oct 19, 2021 at 10:03 AM Duke Normandin
> wrote:
> >
> > On Tue, 19 Oct 2021 09:26:34 +1100
> > Chris Angelico wrote:
> >
> > > On Tue, Oct 19, 2021 at 9:19 AM Duke Normandin
> > > wrote:
> > > >
> > > > Pike v8.0 release 702 r
On Tue, Oct 19, 2021 at 10:03 AM Duke Normandin wrote:
>
> On Tue, 19 Oct 2021 09:26:34 +1100
> Chris Angelico wrote:
>
> > On Tue, Oct 19, 2021 at 9:19 AM Duke Normandin
> > wrote:
> > >
> > > Pike v8.0 release 702 running Hilfe v3.5 (Incremental Pike
> > > Frontend)
> > >
> > > > array(string)
On Tue, 19 Oct 2021 09:26:34 +1100
Chris Angelico wrote:
> On Tue, Oct 19, 2021 at 9:19 AM Duke Normandin
> wrote:
> >
> > Pike v8.0 release 702 running Hilfe v3.5 (Incremental Pike
> > Frontend)
> >
> > > array(string) flat = ({"this", "that", "the", "other"});
> > > flat[1];(4) Result: "that"
On Tue, Oct 19, 2021 at 9:19 AM Duke Normandin wrote:
>
> Pike v8.0 release 702 running Hilfe v3.5 (Incremental Pike Frontend)
>
> > array(string) flat = ({"this", "that", "the", "other"});
> > flat[1];(4) Result: "that"
>
> > flat[1]=3;
> (5) Result: 3
>
> > flat[1];
> (6) Result: 3
>
> I was und
Pike v8.0 release 702 running Hilfe v3.5 (Incremental Pike Frontend)
> array(string) flat = ({"this", "that", "the", "other"});
> flat[1];(4) Result: "that"
> flat[1]=3;
(5) Result: 3
> flat[1];
(6) Result: 3
I was under the impression that array(string) would exclude any
other data types but s
13 matches
Mail list logo