caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Qualification of record fields
@ 2002-12-20  7:43 Eray Ozkural
  2002-12-20 19:49 ` Sven Luther
  2002-12-23 10:14 ` Pierre Weis
  0 siblings, 2 replies; 5+ messages in thread
From: Eray Ozkural @ 2002-12-20  7:43 UTC (permalink / raw)
  To: caml-list

Hi,

I've got a simple code that does some Unix
    if src_stats.st_kind != Unix.S_REG then exit 1 else ();

My problem is that I have to do
open Unix
for st_kind field to be available. Isn't that kind of strange? I want to use 
Unix without opening it, qualifying symbols whenever necessary.

Thanks,

-- 
Eray Ozkural <eozk@bicom-inc.com>
Software Engineer, BICOM Inc.
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Qualification of record fields
  2002-12-20  7:43 [Caml-list] Qualification of record fields Eray Ozkural
@ 2002-12-20 19:49 ` Sven Luther
  2002-12-23 10:14 ` Pierre Weis
  1 sibling, 0 replies; 5+ messages in thread
From: Sven Luther @ 2002-12-20 19:49 UTC (permalink / raw)
  To: Eray Ozkural; +Cc: caml-list

On Fri, Dec 20, 2002 at 09:43:11AM +0200, Eray Ozkural wrote:
> Hi,
> 
> I've got a simple code that does some Unix
>     if src_stats.st_kind != Unix.S_REG then exit 1 else ();
> 
> My problem is that I have to do
> open Unix
> for st_kind field to be available. Isn't that kind of strange? I want to use 
> Unix without opening it, qualifying symbols whenever necessary.

What about :

  if src_stats.Unix.st_kind != Unix.S_REG then exit 1 else ();

?

Friendly,

Sven Luther
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Qualification of record fields
  2002-12-20  7:43 [Caml-list] Qualification of record fields Eray Ozkural
  2002-12-20 19:49 ` Sven Luther
@ 2002-12-23 10:14 ` Pierre Weis
  2002-12-26  9:03   ` Eray Ozkural
  1 sibling, 1 reply; 5+ messages in thread
From: Pierre Weis @ 2002-12-23 10:14 UTC (permalink / raw)
  To: Eray Ozkural; +Cc: caml-list

Hi,

> I've got a simple code that does some Unix
>     if src_stats.st_kind != Unix.S_REG then exit 1 else ();
> 
> My problem is that I have to do
> open Unix
> for st_kind field to be available. Isn't that kind of strange? I want to use 
> Unix without opening it, qualifying symbols whenever necessary.
> 
> Thanks,
> 
> -- 
> Eray Ozkural <eozk@bicom-inc.com>

You just have to qualify st_kind: qualification in Caml is usable for
labels also. Hence, use:

if src_stats.Unix.st_kind != Unix.S_REG then exit 1;

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Qualification of record fields
  2002-12-23 10:14 ` Pierre Weis
@ 2002-12-26  9:03   ` Eray Ozkural
  2002-12-26 16:54     ` Pierre Weis
  0 siblings, 1 reply; 5+ messages in thread
From: Eray Ozkural @ 2002-12-26  9:03 UTC (permalink / raw)
  To: Pierre Weis; +Cc: caml-list

Hi Pierre and others, thanks for the info.

On Monday 23 December 2002 12:14 pm, Pierre Weis wrote:
> Hi,
>
> You just have to qualify st_kind: qualification in Caml is usable for
> labels also. Hence, use:
>
> if src_stats.Unix.st_kind != Unix.S_REG then exit 1;
>

Not taking into account the capitalization rules I naively had tried:
src_stats.(Unix.st_kind)
:P

Merry Xmas,

-- 
Eray Ozkural <eozk@bicom-inc.com>
Software Engineer, BICOM Inc.
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Caml-list] Qualification of record fields
  2002-12-26  9:03   ` Eray Ozkural
@ 2002-12-26 16:54     ` Pierre Weis
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre Weis @ 2002-12-26 16:54 UTC (permalink / raw)
  To: Eray Ozkural; +Cc: pierre.weis, caml-list

> Not taking into account the capitalization rules I naively had tried:
> src_stats.(Unix.st_kind)
> :P

The parens are not only useless here: they are harmful since the
compiler parses a vector access as in v.(i) !

> Merry Xmas,
> 
> -- 
> Eray Ozkural <eozk@bicom-inc.com>

Merry Christmas to you also,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-12-26 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-20  7:43 [Caml-list] Qualification of record fields Eray Ozkural
2002-12-20 19:49 ` Sven Luther
2002-12-23 10:14 ` Pierre Weis
2002-12-26  9:03   ` Eray Ozkural
2002-12-26 16:54     ` Pierre Weis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).