C and Tk

P

Penguin_X

Hi.

I'm using Tk with Perl. I've take a look on google and many forum about
Tk and C relationship. Is there any way to use it with C ? I would
prefer code compiled Tk programs than interpreted one.

Thank You !
 
J

Jack Klein

Hi.

I'm using Tk with Perl. I've take a look on google and many forum about
Tk and C relationship. Is there any way to use it with C ? I would
prefer code compiled Tk programs than interpreted one.

Thank You !

C does not define an interface to any other language in existence. As
far as the C standard is concerned, C is the only language in the
universe.

If you want to interface C to johnny-come-lately languages like Tk,
Perl, C++, Java, or many, many others, you need to use features
provided by either the other language or your operating system. These
are all non-standard extensions as far as C is concerned, and
off-topic here.

Your best bet is asking in a group that supports your particular
compiler/OS combination.
 
C

Chris McDonald

Jack Klein said:
C does not define an interface to any other language in existence. As
far as the C standard is concerned, C is the only language in the
universe.


In satifying your statement, would you describe the use of the 'asm'
keyword as not being an interface? Its presence certainly admits that
other languages exist, but it isn't really an *interface*.

?

______________________________________________________________________________
Dr Chris McDonald E: (e-mail address removed)
Computer Science & Software Engineering W: http://www.csse.uwa.edu.au/~chris
The University of Western Australia, M002 T: +618 6488 2533
Crawley, Western Australia, 6009 F: +618 6488 1089
 
P

Peter Nilsson

Chris said:
In satifying your statement, would you describe the use of the 'asm'
keyword as not being an interface? Its presence certainly admits that
other languages exist, but it isn't really an *interface*.

A better example is system() where the interface is, in a sense,
completely
specified, even if the execution isn't. ;)
 
G

Gordon Burditt

C does not define an interface to any other language in existence. As
In satifying your statement, would you describe the use of the 'asm'
keyword as not being an interface? Its presence certainly admits that
other languages exist, but it isn't really an *interface*.

What asm keyword? ANSI/ISO C doesn't have such a keyword.
And the use of the variable name "asm" shouldn't cause syntax
errors, or the compiler is broken.

Gordon L. Burditt
 
M

Martin Ambuhl

In satifying your statement, would you describe the use of the 'asm'
keyword as not being an interface?

There is no 'asm' keyword in C. If your implementation provides one,
then it is invading the programmer's namespace. A
 
K

Keith Thompson

Jack Klein said:
If you want to interface C to johnny-come-lately languages like Tk,
Perl, C++, Java, or many, many others, you need to use features
provided by either the other language or your operating system.

Or even johnny-come-early languages like Fortran.
 
K

Keith Thompson

Chris McDonald said:
In satifying your statement, would you describe the use of the 'asm'
keyword as not being an interface? Its presence certainly admits that
other languages exist, but it isn't really an *interface*.

The "asm" keyword was a common extension in some compilers, but it's
not standardized.
 
C

Chris McDonald

Keith Thompson said:
The "asm" keyword was a common extension in some compilers, but it's
not standardized.

Could someone please explain to me, then (honestly), the role of items in
Annex J (informative, Portability issues of the International standard)?
J.5.10 specifically states that 'asm' is a keyword.

Are the items in Annex J "not standard enough" for the purists of
this group?

______________________________________________________________________________
Dr Chris McDonald E: (e-mail address removed)
Computer Science & Software Engineering W: http://www.csse.uwa.edu.au/~chris
The University of Western Australia, M002 T: +618 6488 2533
Crawley, Western Australia, 6009 F: +618 6488 1089
 
M

Michael Mair

Chris said:
Could someone please explain to me, then (honestly), the role of items in
Annex J (informative, Portability issues of the International standard)?
J.5.10 specifically states that 'asm' is a keyword.

Are the items in Annex J "not standard enough" for the purists of
this group?

I fear the answer is "yes"; Annex J is informative, not normative.
It describes in J.5 common extensions but whether this is
__asm, __asm__, asm() or something else is up to the implementation.


Cheers
Michael
 
F

Flash Gordon

Chris said:
In satifying your statement, would you describe the use of the 'asm'
keyword as not being an interface? Its presence certainly admits that
other languages exist, but it isn't really an *interface*.

?

It does not matter how you describe asm since it is a non-standard
extension, although a common one.
 
P

Peter Nilsson

Chris said:
Could someone please explain to me, then (honestly), the role of items in
Annex J (informative, Portability issues of the International standard)?
J.5.10 specifically states that 'asm' is a keyword.

Are the items in Annex J "not standard enough" for the purists of
this group?

No, since 'informative' sections are non-normative. So, like footnotes,
they
have no direct bearing on the requirements of a conforming
implementation.

More importantly, a conforming hosted implementation _must_ accept and
correctly execute code like...

#include <stdio.h>

int main(void)
{
int asm = 42;
printf("%d\n", asm);
return 0;
}
 
C

CBFalconer

Chris said:
In satifying your statement, would you describe the use of the
'asm' keyword as not being an interface? Its presence certainly
admits that other languages exist, but it isn't really an
*interface*.

There is no such keyword in C. It is merely a common extension,
and not governed by any standard. As such, it does not exist in
this newsgroup.
 
S

SM Ryan

#
# >The "asm" keyword was a common extension in some compilers, but it's
# >not standardized.
#
# Could someone please explain to me, then (honestly), the role of items in
# Annex J (informative, Portability issues of the International standard)?
# J.5.10 specifically states that 'asm' is a keyword.
#
# Are the items in Annex J "not standard enough" for the purists of
# this group?

You're talking to a close minded clique who have ruined comp.lang.c
by trying to moderate unmoderated newsgroup. For some reason they
think "C" is a trademarked term owned by ANSI/ISO; they lack sufficient
neuron mass to realize that "C" actually applies to a variety of
dialects.
 
L

Lawrence Kirby

Could someone please explain to me, then (honestly), the role of items in
Annex J (informative, Portability issues of the International standard)?
J.5.10 specifically states that 'asm' is a keyword.

Annex J simply provides some background information. It is not normative
which means that its contents do not have any bearing on the language
specification. In fact some of the things it describes, an "asm keyword"
included are in violation of the C standard. When a compiler is run in a
mode that supports it it is not a conforming C implementation because it
breaks the syntax of the language and invades the user namespace. E.g.

int main(void)
{
int asm = 0;
return 0;
}

is a strictly conforming C program with asm having the clear semantics of
a variable identifier.

Are the items in Annex J "not standard enough" for the purists of
this group?

The explicit purpose (as in "Common Extensions") of section J.5 is to
describe things that are non-standard.

Lawrence
 
D

Dave Marquardt

"Penguin" == Penguin X <Penguin_X> writes:

Penguin> I'm using Tk with Perl. I've take a look on google and many forum
Penguin> about Tk and C relationship. Is there any way to use it with C ? I
Penguin> would prefer code compiled Tk programs than interpreted one.

Sure, Tk is implemented as a library. Go over to comp.lang.tcl or
http://www.tcl.tk for more information.
 
A

Alan Balmer

In satifying your statement, would you describe the use of the 'asm'
keyword as not being an interface? Its presence certainly admits that
other languages exist, but it isn't really an *interface*.
Neither is it part of the C language.
 
W

Walter Roberson

Neither is it part of the C language.

'asm' and 'fortran' are part of K&R C. K&R 2nd edition, section
A2.4 Keywords,

"Some implementations also reserve the words fortran and asm."


C89, in the Rationale, section 3.1.1 Keywords, notes,

The keywords entry, fortran, and asm have not been included since
they were either never used, or are not portable. Uses of fortran
and asm as keywords are noted as common extensions.



I'm not a sharp enough language-lawyer to resolve this question:

When the C89 standard admits of something being a "common extension"
then is a compiler "non-compliant" for implementing that extension
(e.g., due to potential clashes with use of those words in code)?

If so, would it be sufficient for the compiler to provide a means to
turn off recognizition of the extension?
 
K

Keith Thompson

When the C89 standard admits of something being a "common extension"
then is a compiler "non-compliant" for implementing that extension
(e.g., due to potential clashes with use of those words in code)?

Yes. A compiler that rejects a strictly conforming program is
non-compliant.
If so, would it be sufficient for the compiler to provide a means to
turn off recognizition of the extension?

Yes.
 
J

Jack Klein

#
# >The "asm" keyword was a common extension in some compilers, but it's
# >not standardized.
#
# Could someone please explain to me, then (honestly), the role of items in
# Annex J (informative, Portability issues of the International standard)?
# J.5.10 specifically states that 'asm' is a keyword.
#
# Are the items in Annex J "not standard enough" for the purists of
# this group?

You're talking to a close minded clique who have ruined comp.lang.c
by trying to moderate unmoderated newsgroup. For some reason they
think "C" is a trademarked term owned by ANSI/ISO; they lack sufficient
neuron mass to realize that "C" actually applies to a variety of
dialects.

Indeed, and yet I am about to award you the honor of a non-standard
expression, albeit the standard involved is not that of the C
language:

#plonk#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,166
Messages
2,570,907
Members
47,448
Latest member
DeanaQ4445

Latest Threads

Top