Re: Any Prolog language lawyer out there?

From: Bart Demoen (bmd_at_cs.kuleuven.ac.be)
Date: 10/20/04

  • Next message: Jan Wielemaker: "Re: SWI-prolog, XPCE help"
    Date: Wed, 20 Oct 2004 14:09:14 +0200
    
    

    I wrote:

    > Goal : integer(- 4)
    > Specification result : Must fail
    >
    >
    >
    > Goal : integer(-4)
    > Specification result : Must succeed
    >
    >
    > So it seems that the space between the - and the 4 is important.
    >
    > I do not have the final copy of the standard, and although I do remember
    > that there has been discussion about it, I do not remember the final
    > outcome,
    > so can anybody check that's indeed what the standard says ?

    I got hold of a standard ...

    It says at the end of section that Jens was quoting from:

    "A term which is the name - followed directly by a numeric constant,
    denotes the cirresponding negative constant"

    In the standard "directly" means something like "with no space in between".

    That decides the issue I think: - 4 should not be read as a negative integer;
    and -4 should be read as a negative integer.

    Cheers

    Bart Demoen


  • Next message: Jan Wielemaker: "Re: SWI-prolog, XPCE help"

    Relevant Pages

    • Re: Renaming all symbols in libmp(3)
      ... where appropriate, fail to respect FENV_ACCESS and other pragmas, ... the complex builtins use simplified formulas that don't ... The compiler may do magic with any call which has semantics defined by the C standard in a hosted environment. ... I prefer the crash variant (or the one with the demons flying out of the programmers nose), because I've seen quite some programs which showed me "" where they should have printed something sensible and bugs only seem to have a real chance of being fixed in a timely manner, when they are hard crashes. ...
      (freebsd-hackers)
    • Re: Static-Initializer Failure Values...
      ... You want to be sure that there's no possible way the actual lock can fail due to inability to require any resources needed to lock that might not have been acquired by PTHREAD_MUTEX_INITIALIZER. ... In fact, explicitly calling pthread_mutex_initwon't help, either; there's no guarantee that it's really any different from static initialization. ... POSIX does not attempt to prevent implementations of the standard from extending the standard in a variety of ways and for a variety of reasons. ... So all I can really say is what I said before: you shouldn't EXPECT that any implementation you're likely to encounter will routinely cause a mutex operation on a statically initialized mutex to fail. ...
      (comp.programming.threads)
    • Re: Renaming all symbols in libmp(3)
      ... where appropriate, fail to respect FENV_ACCESS and other pragmas, ... possible interpretation of the C standard. ... which once again has undefined behavior. ... violation, and the extension worked just fine for many years. ...
      (freebsd-hackers)
    • Re: set and reset the least significant bit of a address
      ... > The conversion to and from intptr_t is implementation defined. ... property that any valid pointer to void can be converted to ... The current C standard is C99. ... What I fail to understand are the people that always ...
      (comp.lang.c)
    • Re: Is this fully portable and/or smart?
      ... Both fseekand rewindcould fail, but you don't check for errors. ... Yeah, heard THAT before... ... the way the standard leaves behavior undefined in many cases). ... But for each possible error condition, ...
      (comp.lang.c)