throwEintr (string funcName) pure noreturn
{
throw new Exception (funcName ~ () was interrupted by the
OS);
}
void exacerbate (T) (const(T) exc, string msg) pure noreturn
{
throw new T (msg ~ : ~ exc.msg);
}
If your patch enforcing that a function tagged with noreturn does
not return (so
If your patch enforcing that a function tagged with noreturn
does not return (so core.stdc.stdlib.exit must be tagged with
noreturn)?
It isn't currently compulsory. Any noreturn function will still
compile without the attribute. If adopted, it would of course be
prudent to make stdlib.exit
On Mon, 14 May 2012 17:59:19 -0400, Timon Gehr timon.g...@gmx.ch wrote:
On 05/13/2012 06:13 PM, Alex Rønne Petersen wrote:
Hi,
If memory serves me right, there were some proposals in the past to add
a @noreturn attribute to the language. Where did this go?
In writing unwinding mechanisms
On 05/16/2012 02:27 PM, Steven Schveighoffer wrote:
On Mon, 14 May 2012 17:59:19 -0400, Timon Gehr timon.g...@gmx.ch wrote:
On 05/13/2012 06:13 PM, Alex Rønne Petersen wrote:
Hi,
If memory serves me right, there were some proposals in the past to add
a @noreturn attribute to the language
signature. Due to a bug,
they are not for DMD.
OK, then I would support this as a method of specifying @noreturn
BTW, is this bug reported?
-Steve
?
Contracts are supposed to be part of the method signature. Due to a
bug, they are not for DMD.
OK, then I would support this as a method of specifying @noreturn
BTW, is this bug reported?
-Steve
Yes. http://d.puremagic.com/issues/show_bug.cgi?id=6549
Stewart has turned
On 05/14/12 23:59, Timon Gehr wrote:
On 05/13/2012 06:13 PM, Alex Rønne Petersen wrote:
Hi,
If memory serves me right, there were some proposals in the past to add
a @noreturn attribute to the language. Where did this go?
In writing unwinding mechanisms for my VM, I find myself actually
On 14 May 2012 22:59, Timon Gehr timon.g...@gmx.ch wrote:
On 05/13/2012 06:13 PM, Alex Rønne Petersen wrote:
Hi,
If memory serves me right, there were some proposals in the past to add
a @noreturn attribute to the language. Where did this go?
In writing unwinding mechanisms for my VM, I
Alex Rønne Petersen:
In writing unwinding mechanisms for my VM, I find myself
actually needing some sort of @noreturn function attribute that
would tell the compiler that the function does not return,
Maybe Walter will listen you more if you show an example of
where/why you would use
On 14-05-2012 14:13, Alex Rønne Petersen wrote:
On 14-05-2012 13:53, bearophile wrote:
Alex Rønne Petersen:
In writing unwinding mechanisms for my VM, I find myself actually
needing some sort of @noreturn function attribute that would tell the
compiler that the function does not return
On 14-05-2012 13:53, bearophile wrote:
Alex Rønne Petersen:
In writing unwinding mechanisms for my VM, I find myself actually
needing some sort of @noreturn function attribute that would tell the
compiler that the function does not return,
Maybe Walter will listen you more if you show
On 14 May 2012 13:21, Alex Rønne Petersen xtzgzo...@gmail.com wrote:
On 14-05-2012 14:13, Alex Rønne Petersen wrote:
On 14-05-2012 13:53, bearophile wrote:
Alex Rønne Petersen:
In writing unwinding mechanisms for my VM, I find myself actually
needing some sort of @noreturn function
On 05/13/2012 06:13 PM, Alex Rønne Petersen wrote:
Hi,
If memory serves me right, there were some proposals in the past to add
a @noreturn attribute to the language. Where did this go?
In writing unwinding mechanisms for my VM, I find myself actually
needing some sort of @noreturn function
On 14-05-2012 23:59, Timon Gehr wrote:
On 05/13/2012 06:13 PM, Alex Rønne Petersen wrote:
Hi,
If memory serves me right, there were some proposals in the past to add
a @noreturn attribute to the language. Where did this go?
In writing unwinding mechanisms for my VM, I find myself actually
On 05/15/2012 12:14 AM, Alex Rønne Petersen wrote:
On 14-05-2012 23:59, Timon Gehr wrote:
On 05/13/2012 06:13 PM, Alex Rønne Petersen wrote:
Hi,
If memory serves me right, there were some proposals in the past to add
a @noreturn attribute to the language. Where did this go?
In writing
On Monday, May 14, 2012 23:59:19 Timon Gehr wrote:
On 05/13/2012 06:13 PM, Alex Rønne Petersen wrote:
Hi,
If memory serves me right, there were some proposals in the past to add
a @noreturn attribute to the language. Where did this go?
In writing unwinding mechanisms for my VM, I
Hi,
If memory serves me right, there were some proposals in the past to add
a @noreturn attribute to the language. Where did this go?
In writing unwinding mechanisms for my VM, I find myself actually
needing some sort of @noreturn function attribute that would tell the
compiler
On 13 May 2012 17:13, Alex Rønne Petersen xtzgzo...@gmail.com wrote:
Hi,
If memory serves me right, there were some proposals in the past to add a
@noreturn attribute to the language. Where did this go?
In writing unwinding mechanisms for my VM, I find myself actually needing
some sort
On Saturday, December 24, 2011 22:26:02 Andrei Alexandrescu wrote:
On 12/24/2011 06:58 PM, Vladimir Panteleev wrote:
On Saturday, 24 December 2011 at 20:09:46 UTC, bearophile wrote:
GNU C has a noreturn attribute since a lot of time. I don't fully
understand why such attribute is so useful
);
#include stdlib.h
_Noreturn void abort(void);
#include stdlib.h
_Noreturn void exit(int status);
#include stdlib.h
_Noreturn void _Exit(int status);
#include stdlib.h
_Noreturn void quick_exit(int status);
GNU C has a noreturn attribute since a lot of time. I don't fully understand
why
On Saturday, 24 December 2011 at 20:09:46 UTC, bearophile wrote:
GNU C has a noreturn attribute since a lot of time. I don't
fully understand why such attribute is so useful in C programs,
but is something like a @noreturn function attribute useful in
D too? Maybe to implement a better halt
On Sat, Dec 24, 2011 at 2:09 PM, bearophile bearophileh...@lycos.comwrote:
I don't fully understand why such attribute is so useful in C programs
Bye,
bearophile
Functions are like people. Sometimes they go places that's so beautiful
that they never want to return.
On 12/24/2011 06:58 PM, Vladimir Panteleev wrote:
On Saturday, 24 December 2011 at 20:09:46 UTC, bearophile wrote:
GNU C has a noreturn attribute since a lot of time. I don't fully
understand why such attribute is so useful in C programs, but is
something like a @noreturn function attribute
On Fri, 22 Oct 2010 13:22:19 -0400, Stewart Gordon smjg_1...@yahoo.com
wrote:
On 22/10/2010 03:44, Rainer Deyke wrote:
snip
A 'void' function returns, therefore it conceptually returns a value.
For generic programming, it is useful to treat 'void' as a type like any
other, except that it
On 25/10/2010 16:18, Steven Schveighoffer wrote:
snip
I proposed earlier that maybe you shouldn't be able to create void
arrays directly. This would help with the contains pointers issue.
Indeed, void data is another issue here:
http://d.puremagic.com/issues/show_bug.cgi?id=679
Maybe we can
On 22/10/2010 03:44, Rainer Deyke wrote:
snip
A 'void' function returns, therefore it conceptually returns a value.
For generic programming, it is useful to treat 'void' as a type like any
other, except that it only has one possible value (and therefore encodes
no information and requires no
Ada 95 too has a No_return pragma, see page 12-14 of the PDF file here, it
explains various things:
http://www.adacore.com/2006/02/02/ada-2005-rationale-exceptions-generics-etc-part-6-of-8/
Bye,
bearophile
On 10/22/10 19:24 CDT, bearophile wrote:
Ada 95 too has a No_return pragma, see page 12-14 of the PDF file here, it
explains various things:
http://www.adacore.com/2006/02/02/ada-2005-rationale-exceptions-generics-etc-part-6-of-8/
The one cool and interesting thing about non-returning
to
the compiler to let it know that a function is never going to return.
Example:
@noreturn void fatal()
{
print(Error);
exit(1);
}
The 'noreturn' keyword would tell the compiler that 'fatal' cannot return, and
can then optimise without regard to what would happen if 'fatal' ever did
Thoughts?
I really, really like the idea.
Iain Buclaw:
@noreturn void fatal()
{
print(Error);
exit(1);
}
See also the same feature in GNU C:
http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html#index-g_t_0040code_007bnoreturn_007d-function-attribute-2455
Bye,
bearophile
of a function body. It would be nice however if you
can give hints to the compiler to let it know that a function is never
going to return.
Example:
@noreturn void fatal()
{
print(Error);
exit(1);
}
The 'noreturn' keyword would tell the compiler that 'fatal' cannot
return, and can
this. Currently in D2, you must either have a 'return' or 'assert(0)'
statement at the end of a function body. It would be nice however if you
can give hints to the compiler to let it know that a function is never
going to return.
Example:
@noreturn void fatal()
{
print(Error);
exit(1
, you must either have a 'return' or 'assert(0)'
statement at the end of a function body. It would be nice however if you
can give hints to the compiler to let it know that a function is never
going to return.
Example:
@noreturn void fatal()
{
print(Error);
exit(1
.
Example:
@noreturn void fatal()
{
print(Error);
exit(1);
}
The 'noreturn' keyword would tell the compiler that 'fatal' cannot
return, and can then optimise without regard to what would happen if
'fatal' ever did return. This should also allow fatal to be used
instead of a return
. It would be nice however if you can give hints to
the compiler to let it know that a function is never going to return.
Example:
@noreturn void fatal()
{
print(Error);
exit(1);
}
The 'noreturn' keyword would tell the compiler that 'fatal' cannot return, and
can then optimise without regard
)' statement at
the end of a function body. It would be nice however if you can give hints to
the compiler to let it know that a function is never going to return.
Example:
@noreturn void fatal()
{
print(Error);
exit(1);
}
The 'noreturn' keyword would tell the compiler that 'fatal' cannot
either have a 'return' or 'assert(0)' statement at
the end of a function body. It would be nice however if you can give hints
to
the compiler to let it know that a function is never going to return.
Example:
@noreturn void fatal()
{
print(Error);
exit(1
this.
Currently in D2, you must either have a 'return' or 'assert(0)' statement
at
the end of a function body. It would be nice however if you can give hints
to
the compiler to let it know that a function is never going to return.
Example:
@noreturn void fatal()
{
print
Ezneh:
I saw something that can be good too about returned values in Nimrod :
http://force7.de/nimrod/tut1.html#discard-statement
Hope the explanation is sufficient. This way, the programmer knows when he
throws away a returned value.
I think that could be great too.
In C-like languages
On 10/21/2010 05:54, Iain Buclaw wrote:
@noreturn void fatal()
{
print(Error);
exit(1);
}
Thoughts?
This looks wrong to me. 'fatal' returns type 'void', except that it
doesn't. I would prefer this:
null_type fatal()
{
print(Error);
exit(1);
}
Here 'null_type' is a type
== Quote from Rainer Deyke (rain...@eldwood.com)'s article
On 10/21/2010 05:54, Iain Buclaw wrote:
@noreturn void fatal()
{
print(Error);
exit(1);
}
Thoughts?
This looks wrong to me. 'fatal' returns type 'void', except that it
doesn't. I would prefer this:
null_type fatal
On 10/21/10 12:21 CDT, Rainer Deyke wrote:
Feel free to think of a better name than 'null_type'.
It's a theory classic called none or bottom. It's the bottom of the
subtyping lattice, the subtype of all possible types, a type that can
never be instantiated.
The feature is nice to have but
Daniel Gibson, el 21 de octubre a las 17:15 me escribiste:
You want to include in the language what you can do (or at least could)
do in GDC using:
pragma(GNU_attribute, noreturn)) void fatal()
{
print(Error);
exit(1);
}
?
Obviously he wants a portable way to do
)' statement
at
the end of a function body. It would be nice however if you can give hints
to
the compiler to let it know that a function is never going to return.
Example:
@noreturn void fatal()
{
print(Error);
exit(1);
}
The 'noreturn' keyword would tell the compiler
Nick Sabalausky:
One of the nice things about that is you don't have to provide a fake
return type. For instance, with your @noreturn: @noreturn int foo()
would be legal, but wouldn't make any sence. And in a way, even @noreturn
void foo() isn't great since a void return value suggests
bearophile, el 21 de octubre a las 17:35 me escribiste:
Nick Sabalausky:
One of the nice things about that is you don't have to provide a fake
return type. For instance, with your @noreturn: @noreturn int foo()
would be legal, but wouldn't make any sence. And in a way, even @noreturn
== Quote from Leandro Lucarella (l...@llucax.com.ar)'s article
bearophile, el 21 de octubre a las 17:35 me escribiste:
Nick Sabalausky:
One of the nice things about that is you don't have to provide a fake
return type. For instance, with your @noreturn: @noreturn int foo()
would
as
noreturn?
A 'void' function returns, therefore it conceptually returns a value.
For generic programming, it is useful to treat 'void' as a type like any
other, except that it only has one possible value (and therefore encodes
no information and requires no storage). If this is not implemented in
D
http://d.puremagic.com/issues/show_bug.cgi?id=1931
Don clugd...@yahoo.com.au changed:
What|Removed |Added
Status|REOPENED|RESOLVED
401 - 450 of 450 matches
Mail list logo