..
   This file is part of Logtalk <https://logtalk.org/>  
   Copyright 1998-2021 Paulo Moura <pmoura@logtalk.org>
   SPDX-License-Identifier: Apache-2.0

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.


.. _faq_usability:

Usability
=========

* :ref:`faq_usability_shortcuts`
* :ref:`faq_usability_ensure_loaded`
* :ref:`faq_usability_make`

.. _faq_usability_shortcuts:

Is there a shortcut for compiling and loading source files?
-----------------------------------------------------------

Yes. With most backend Prolog compilers, you can use ``{File}`` as a
shortcut for ``logtalk_load(File)``. For compiling and loading
multiple files simply use ``{File1, File2, ...}``. See the documentation
of the :ref:`predicates_logtalk_load_1` predicate for details.

.. _faq_usability_ensure_loaded:

Is there an equivalent directive to the ``ensure_loaded/1`` Prolog directive?
-----------------------------------------------------------------------------

You can use the goal ``logtalk_load(File, [reload(skip)])`` to ensure
that ``File`` is only loaded once. See the documentation
of the :ref:`predicates_logtalk_load_2` predicate for details.

.. _faq_usability_make:

Are there shortcuts for the make functionality?
-----------------------------------------------

Yes. With most backend Prolog compilers, you can use ``{*}`` as a
shortcut for ``logtalk_make(all)`` to reload all files modified since
last compiled and loaded, ``{!}`` as a shortcut for
``logtalk_make(clean)`` to delete all intermediate Prolog files
generated by the compilation of Logtalk source files, ``{?}`` as a
shortcut for ``logtalk_make(missing)`` to list missing entities and
predicates, and ``{@}`` as a shortcut for ``logtalk_make(circular)``
to list circular references. See the documentation
of the :ref:`predicates_logtalk_make_1` predicate for details.
