Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 30 19:28

    pmoura on master

    Smaller `packs` tool predicate … (compare)

  • Jun 30 15:33

    pmoura on master

    Workaround ECLiPSe internal fil… Fix `packs` tool bug when insta… Update SVG diagrams (compare)

  • Jun 30 08:51

    pmoura on master

    Change `packs` tool `restore/2`… Update SVG diagrams (compare)

  • Jun 29 13:21

    pmoura on master

    Change semantics of the `packs`… Update SVG diagrams (compare)

  • Jun 29 00:07

    pmoura on master

    Improve Handbook section on ref… (compare)

  • Jun 28 21:43

    pmoura on master

    Fix typo in the latest changes … (compare)

  • Jun 28 14:15

    pmoura on master

    Add predicates `registry_protoc… Update SVG diagrams (compare)

  • Jun 27 21:38

    pmoura on master

    Improve new Handbook section on… (compare)

  • Jun 27 18:01

    pmoura on master

    Add Handbook section on documen… (compare)

  • Jun 27 15:21

    pmoura on master

    Fix outdated testing instructio… (compare)

  • Jun 26 21:56

    pmoura on master

    Fix `packs` tool to only warn a… Update SVG diagrams (compare)

  • Jun 26 21:27

    pmoura on master

    Workaround issues with operatin… Update SVG diagrams (compare)

  • Jun 26 17:13

    pmoura on master

    Update `packs` tool to also rec… Update SVG diagrams (compare)

  • Jun 25 09:58

    pmoura on master

    Fix CxProlog and XSB adapter fi… (compare)

  • Jun 25 09:17

    pmoura on master

    Fix SICStus Prolog adapter file… (compare)

  • Jun 24 17:05

    pmoura on master

    Change `cvs/3` library object t… Update SVG diagrams (compare)

  • Jun 24 15:05

    pmoura on master

    Revert "Change default header p… Revert "Update `csv` library te… (compare)

  • Jun 24 14:39

    pmoura on master

    Update `csv` library tests for … (compare)

  • Jun 24 09:53

    pmoura on master

    Change default header parameter… Update SVG diagrams (compare)

  • Jun 24 08:58

    pmoura on master

    Update `csv` library documentat… (compare)

A Man With A Clever Disguise
@ACleverDisguise
This was in the rbtree.
Here's check/1:
    check(Term) :-
        (    valid(Term) ->
            true
        ;    var(Term) ->
            instantiation_error
        ;    type_error(rbtree, Term)
        ).
It calls valid/1 which is here:
    valid(X) :-
        var(X),
        !,
        fail.
    valid(t(Nil,Nil)) :-
        !.
    valid(t(_,Tree)) :-
        catch(check_rbtree_root(Tree), _, fail).
So the first clause of valid/1 calls var/1 right off the start. Then it does the weird cut and fail thing.
A Man With A Clever Disguise
@ACleverDisguise
Now by my reading that's saying, loosely, "if X is not grounded, fail hard so you don't come back".
Then the very next clause in the conditional calls var/1.
Throwing an instantiation_error.
Now what I don't understand is why you're structuring this. I thought exceptions wipe away choice points. As do conditionals, in fact? (One of the reasons why conditionals are considered code smell by people like ROK, IIRC?)
The construct var/1, !, fail looks a lot like you're trying to chew away choice points, but ... the action for the var/1 situation later is an exception so I'm a bit baffled.
Paulo Moura
@pmoura
See the documentation on the valid/1 and check/1 predicates.
That said, type-checking nowadays is preferably accomplished using the type object.
Jacob Friedman
@jacobfriedman
Could types be used over attributed variables?
Paulo Moura
@pmoura
I guess you could typ-check the attribute values. But note that attributed variables are not standard.
Paulo Moura
@pmoura
Logtalk 3.50.0 released with focus on improved documentation, developer tools, and test suites.
A Man With A Clever Disguise
@ACleverDisguise
Paulo: In the installation, could you copy settings.lgt forward when the dates in the header match that of settings-sample.lgt?
Paulo Moura
@pmoura
The logtalk_user_setupscripts already copies the $LOGTALKUSER/settings.lgt(or $LOGTALKUSER/settings.logtalk) file forward if it exists.
A Man With A Clever Disguise
@ACleverDisguise
I just installed 3.50.0 on three environments (Windows 10, Windows 10 WSL, Linux Mint) and in none of those cases did it copy settings.lgt forward.
I had to manually copy them forward from the backup.
Paulo Moura
@pmoura
I assume you used the Windows .exe installer? And either the the .deb or the .rpm installers on Linux Mint?
Paulo Moura
@pmoura
Paulo Moura
@pmoura
In the case of Linux and macOS, the backup of the $LOGTALKUSERdirectory and the copy of any settings.lgtor settings.logtalk file is done not by the installers but by running the logtalk_user_setup script. This script is automatically called when the $LOGTALKUSERdirectory is outdated due to a new Logtalk version been installed.
Paulo Moura
@pmoura
Also note that the settings file can be stored in other locations than the $LOGTALKUSERdirectory and thus not affected by the updating of that folder when installing a new Logtalk version.
A Man With A Clever Disguise
@ACleverDisguise
Used .exe for Windows and .deb for Mint, yes.
Different issue I can't fathom: I'm trying to print debug messages. It's not working. I've compiled the .lgt file with debug(on) in the options. I've manually added set_logtalk_flag(debug, on) in the load script. I am manually TYPING set_logtalk_flag(debug, on) in the toplevel. I am checking that current_logtalk_flag(debug, X) binds 'on' to X.
But all of my print_message(debug, component, Message) calls aren't doing a thing.
If I switch that to information, say, it works.
What step am I missing that makes debug messages display? Does it need to be run in the context of the debugger?
Paulo Moura
@pmoura
Printing of debug messages is indepedent of the debugger (which is an application).
You also don't need to compile code that calls logtalk::print_message(debug, component, Message)in debug mode.
Paulo Moura
@pmoura
You may also want to simplify the calls by defining a predicate shortcut. For example:
:- uses(logtalk, [print_message(debug, foo, Message) as dbg(Message)]).
Printing of debug message requires the debug flag to be on when the call is made, not when the code making the calls is compiled.
A Man With A Clever Disguise
@ACleverDisguise
I'm still completely unable to get debug messages to print. information, warning, error, etc. all do, but debug don't.
Paulo Moura
@pmoura
Maybe put the minimal code required to reproduce the issue in a public paste bin?
A Man With A Clever Disguise
@ACleverDisguise
Before that, just a quick question: in my debug.lgt file:
:- initialization((
    logtalk_load(loader),
    logtalk_load(debugger(loader)),
    set_logtalk_flag(debug, on),
    debugger::trace
)).
Paulo Moura
@pmoura
Isn't the loader file loading the code that you want to debug?
A Man With A Clever Disguise
@ACleverDisguise
The loader file loads the library, yes, and compiles it with debug.
Then in the debug file I load the debugger and set the debug flag.
Paulo Moura
@pmoura
Ok.
A Man With A Clever Disguise
@ACleverDisguise
But in circumstances I'm trying to characterize now, when I do current_logtalk_flag/2 I get 'off'.
And that is likely the source of my problems. But I can't figure out when it's turning the flag off.
Paulo Moura
@pmoura
In that initilization/1 directive above, you're turning on the debug flag globally.
A Man With A Clever Disguise
@ACleverDisguise
Yes. That's what I was expecting.
I want my debug messages to display while I'm debugging.
Paulo Moura
@pmoura
After you load the file above containg that initilization/1 directive, current_logtalk_flag(debug,on) should be true and your debug messages should be displayed.
A Man With A Clever Disguise
@ACleverDisguise
There's a path that somehow gets me to that flag being off.
I haven't figured it out, but that's the source of the problem.