Can't import Render module in Rascal - rascal

I am trying to import the Render module as described in: http://tutor.rascal-mpl.org/Recipes/Recipes.html#/Recipes/Visualization/ParseTree/ParseTree.html
rascal>import ParseTree;
ok
rascal>import vis::Figure;
ok
rascal>import vis::ParseTree;
ok
rascal>import vis::Render;
|prompt:///|(0,19,<1,0>,<1,19>): Could not import module vis::Render: File rascal://vis::Render not found.
?[Advice](http://tutor.rascal-mpl.org/Errors/Static/ModuleImport/ModuleImport.html)
Am I missing something here?

Related

Importing Cubical Agda modules in Agda

I am using agda in Emacs mode. I am trying to start a project which relies on the cubical library. I want to import the module Cubical.Core.Everything. I have only written the following
{-# OPTIONS --without-K #-}
open import Cubical.Core.Everything
When I try to load the file I receive the following error
/home/rymndbkr/myHoTT/Agda/intro.agda:3,1-36
Importing module Cubical.Core.Everything using the
--cubical/--erased-cubical flag from a module which does not.
when scope checking the declaration
open import Cubical.Core.Everything
/home/rymndbkr/myHoTT/Agda/intro.agda:3,1-36
Importing module Cubical.Core.Everything using the --two-level flag
from a module which does not.
when scope checking the declaration
open import Cubical.Core.Everything
I've read through the relevant agda documentation and I don't see anything that addresses this. Does anyone have an idea of whats happening here?
The Cubical Agda libraries can only be used from Cubical Agda. The error message is telling you to change your source file to use Cubical mode:
{-# OPTIONS --cubical #-}

ModuleNameMismatch mystery

Using rascal from the command line, when I type:
import demo::hello
I receive a ModuleNameMismatch error, although the current directory (the one in which I type java -jar rascal-shell-stable.jar) contains a subdirectory named demo containing a file hello.rsc :
module hello
import IO;
void hello(){
println("Hello word");
}
It however works when I type
import hello
and the hello.rsc is in the current directory.
For your info: I am on Windows 10.
The module name must be the full relative path to the module.rsc file.
In this case, the hello.rsc file should be :
module demo::hello
import IO;
void hello(){
println("Hello word");
}
That the reason why it does work when the hello.rsc in the current directory.

Forward package member in dart

I import a package and would forward a member of it. What syntax does Dart offer for that?
foo.dart
import 'package:xzy/xzy.dart'; // contains class Xyz
// how do I forward Xyz here to make it available in bar.dart?
bar.dart
import 'package:mypackage/foo.dart';
Xyz is hidden here
You can use export
import 'package:xzy/xzy.dart';
export 'package:xzy/xzy.dart' show Xyz;
or just
export 'package:xzy/xzy.dart' show Xyz;
You don't need to import for that. Just export is enough if you don't need Xyz in this re-exporting file.
See also
https://www.dartlang.org/guides/libraries/create-library-packages
What is the difference between "show" and "as" in an import statement?

Dart: When you import a file do you import everything that file imports?

Ex.
Files:
1.dart
2.dart
3.dart
2.dart:
import 'package:packagename/3.dart';
1.dart
import 'package:packagename/2.dart';
Does 1.dart import 3.dart?
When you import a file you import
everything public declared in the imported file
everything public declared in part files of the imported file
everything explicitly exported from the imported file
If it is not explicitly exported in it won't be imported transitively.
1.dart does not import 3.dart in your example.
If 2.dart would contain
export 'package:packagename/3.dart';
then 1.dart would also import 3.dart

Could not load lang::java::jdt::Java

When trying to import JAVA modules I receive an error:
// JAVA imports
import lang::java::jdt::Java;
import lang::java::jdt::JDT;
import lang::java::jdt::JavaADT;
Could not load lang::java::jdt::Java
In the console:
rascal>import lang::java::jdt::Java;
|prompt:///|(0,29,<1,0>,<1,29>): Could not import module lang::java::jdt::Java: can not find in search path
Advice: |http://tutor.rascal-mpl.org/Errors/Static/ModuleImport/ModuleImport.html|
I'm using Eclipse and am trying to use the AstNode datatype. Any ideas?
The JDT modules have been replaced a while back by the m3 model.
While they are a bit different, the AST part should be comparable.
Check the m3 ast documentation and the Measuring java recipe.
Is this an old project you are trying to get up and running?

Resources