问一个旧的kerword“条目” [英] Ask an old kerword "entry"

查看:73
本文介绍了问一个旧的kerword“条目”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


这是一个历史问题。


最近,我读了CA参考手册,第三版这本书。 ;。

在本书中,它列出了所有C语言关键字,一个是条目。

我知道它是从ANSCI C中省略的,但我希望我可以找到任何关于它的数据




Doea以前任何人都知道如何使用它吗?

谢谢

解决方案

4月2日,10:11,Lung.S ... @ gmail.com写道:


大家好,


这是一个历史问题。


最近,我读了这本书CA参考手册,第三版。

在本书中,它列出了所有C语言关键字,一个是条目。

我知道它从ANSCI C中省略,但我希望我能找到任何关于它的数据




Doea之前知道如何使用它吗?



原来的Kernighan和Ritchie书说它被保留为

关键字,但没有被任何编译器实现 - 它们不是''给任何

更详细的信息。他们大概有一种感觉,他们可能需要这样一个关键字,并且知道他们会用它做什么,但实际上不需要实际的物化。


ma ********** @ pobox.com 写道:


4月2日,10:11,Lung.S ... @ gmail.com写道:


>这是一个历史问题。

最近,我读了CA参考手册,第三版一书。
在此book,它列出了所有C语言关键字,一个是entry。
我知道它从ANSCI C中省略,但我希望我能找到关于它的任何数据。
<之前,Doea有谁知道如何使用它?



原来的Kernighan和Ritchie书说它被保留为

关键字,但没有被任何编译器实现 - 它们不是''给任何

更详细的信息。他们可能有一种感觉,他们可能需要这样一个关键字,并且知道他们会用它做什么,但实际上需要实际的物化。



我认为某些版本的Fortran有一个条目。关键字,允许

为子程序指定多个入口点。 (我不知道
知道这是否能存活到现代Fortran中。)例如,

伪伪C:


void foo(void)

{

printf(" FOO");

条目栏:

printf(BAR \ n);

}


调用foo()会打印FOO BAR;调用bar()将打印BAR。

(可能会有一些声明语法使调用者可以看到名称

" bar")


我见过一个更实际的例子,它将sin()和cos()结合到

a单一函数中。通过主入口点调用它将调整参数;
调整参数;函数的其余部分,在

辅助入口点之后,将计算(可能是

调整后)参数的正弦,这恰好是未调整的<的余弦

参数。


-

Keith Thompson(The_Other_Keith) ks *** @ mib.org < http://www.ghoti.net/~kst>

圣地亚哥超级计算机中心< *< http:/ /users.sdsc.edu/~kst>

我们必须做点什么。这是事情。因此,我们必须这样做。

- Antony Jay和Jonathan Lynn,是部长


Keith Thompson写道:


我认为某些版本的Fortran有一个条目。关键字,允许

为子程序指定多个入口点。 (我不知道
知道这是否能存活到现代Fortran中。)



ENTRY是现代Fortran的一部分(至少通过F95) )。 F77放宽了对其使用的限制,使其比F66更常见。

当前语法添加了一个它之前没有的RESULT子句。

F2C和g77都为每个条目编写了一个单独的副本,所以你的

伪-C的例子,如果它是等效的Fortran,


void foo(void)

{< br $> b $ b printf(" FOO");

条目栏:

printf(" BAR \ n");

}



将按其编写的方式进行编译

void foo(无效)

{

printf(" FOO");

printf(" BAR \ nn);

}

void bar(无效)

{

printf(" BAR \ nn);

}


Hi all,

It is a history question.

Recently, I read the book "C A reference manual, third edition".
In this book, it list all C language keyword, and one is "entry".
I know it is omitted from ANSCI C, but I hope I can find any data
about it.

Doea any one know how to use it, before?
Thanks

解决方案

On 2 Apr, 10:11, Lung.S...@gmail.com wrote:

Hi all,

It is a history question.

Recently, I read the book "C A reference manual, third edition".
In this book, it list all C language keyword, and one is "entry".
I know it is omitted from ANSCI C, but I hope I can find any data
about it.

Doea any one know how to use it, before?

The original Kernighan and Ritchie book says that it was reserved as a
keyword, but not implemented by any compiler - they don''t give any
more detail. They presumably had a feeling that they might need such a
keyword, and some idea what they would use it for, but the need never
actually materialized.


ma**********@pobox.com writes:

On 2 Apr, 10:11, Lung.S...@gmail.com wrote:

>It is a history question.

Recently, I read the book "C A reference manual, third edition".
In this book, it list all C language keyword, and one is "entry".
I know it is omitted from ANSCI C, but I hope I can find any data
about it.

Doea any one know how to use it, before?


The original Kernighan and Ritchie book says that it was reserved as a
keyword, but not implemented by any compiler - they don''t give any
more detail. They presumably had a feeling that they might need such a
keyword, and some idea what they would use it for, but the need never
actually materialized.

I think some versions of Fortran have an "entry" keyword, allowing
more than one entry point to be specified for a subroutine. (I don''t
know whether this survived into modern Fortran.) For example,
in pseudo-C:

void foo(void)
{
printf("FOO ");
entry bar:
printf("BAR\n");
}

Calling foo() would print "FOO BAR"; calling bar() would print "BAR".
(Presumably there would be some declaration syntax to make the name
"bar" visible to the caller.)

I''ve seen a more realistic example that combines sin() and cos() into
a single function. Calling it through the primary entry point would
adjust the argument; the remainder of the function, after the
secondary entry point, would compute the sine of the (possibly
adjusted) argument, which happens to be the cosine of the unadjusted
argument.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


Keith Thompson wrote:

I think some versions of Fortran have an "entry" keyword, allowing
more than one entry point to be specified for a subroutine. (I don''t
know whether this survived into modern Fortran.)

ENTRY is part of modern Fortran (at least through F95). F77 relaxed the
restrictions on its use, making it even more common than F66. The
current syntax has added a RESULT clause that it did not have earlier.

F2C and g77 both compiled a separate copy for each entry, so your
pseudo-C example, if it were the equivalent Fortran,

void foo(void)
{
printf("FOO ");
entry bar:
printf("BAR\n");
}

would be compiled as it it were written
void foo(void)
{
printf("FOO ");
printf("BAR\n");
}
void bar(void)
{
printf("BAR\n");
}


这篇关于问一个旧的kerword“条目”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆