Re: How to replace a term to the inside of an other term?



student wrote:
With this program and SWI-Prolog Version 5.4.6
I get

?- replace(4, 4, h(999), T1).
T1 = h(999) ;
No

Unfortunately, you rely here on a bug in SWI-Prolog:

?- X =.. [foo(a)].
X = foo(a)
Yes

This isn't standard-conforming and should make a type error.
And before someone claims that it's a feature: =../2 is
supposed to be logical and deterministic, so you can't have
both foo(a)=..[foo,a] and foo(a)=..[foo(a)] being true.
As exemplified by

?- foo(a)=..[foo(a)].
No

-- Joachim
.



Relevant Pages

  • Missing Office Startup Assistant - Home & Student 2007
    ... I am running Office Home & Student 2007 in Vista. ... feature called the Office Startup Assistant. ... the Office Startup Assistant in the 2007 Office suites and in Office 2003" ...
    (microsoft.public.office.setup)
  • JBGI video format change...
    ... the Student Center that gives each member student his own area to post ... their videos and personal information, ... Jimmy keeps adding lessons (he's working on Jazz Blues ... Center feature is new, and is just getting started, but is already ...
    (rec.music.makers.guitar.jazz)
  • Re: =RAND()
    ... As others have indicated there is no way to disable the feature. ... As far as I know the dummy text is only inserted when entering a paragraph mark and then only when the complete paragraph is "=RAND" optionally surrounded by white space ... I would think it pretty unusual - even when documenting Excel functions - for this to happen unintentionally, and on the occasions that it does, it can be undone very easily. ... Gary's Student ...
    (microsoft.public.word.newusers)
  • RE: registration errors
    ... the feature that you're trying to use doesn't exist on your ... version of the software package. ... Are you using the student version of ... (When you are finished with this correspondence thread, ...
    (microsoft.public.office.misc)