Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.eolang.Atom;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -23,6 +24,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "dir.made.mkdir")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOdir$EOmade$EOmkdir extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.eolang.Atom;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -26,6 +27,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "dir.tmpfile.touch")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOdir$EOtmpfile$EOtouch extends PhDefault implements Atom {

Expand Down
2 changes: 2 additions & 0 deletions eo-runtime/src/main/java/org/eolang/EOfs/EOdir$EOwalk.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.eolang.Attrs;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -32,6 +33,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "dir.walk")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOdir$EOwalk extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.eolang.Atom;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -26,6 +27,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "file.deleted.delete")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOfile$EOdeleted$EOdelete extends PhDefault implements Atom {

Expand Down
2 changes: 2 additions & 0 deletions eo-runtime/src/main/java/org/eolang/EOfs/EOfile$EOexists.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.eolang.Atom;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -24,6 +25,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "file.exists")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOfile$EOexists extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.eolang.Atom;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -23,6 +24,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "file.is-directory")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOfile$EOis_directory extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.eolang.Atom;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -26,6 +27,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "file.moved.move")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOfile$EOmoved$EOmove extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.eolang.Attr;
import org.eolang.Attrs;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -27,6 +28,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "file.open.file-stream.read.chunk")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOfile$EOopen$EOfile_stream$EOread$EOchunk
extends PhDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.eolang.Attrs;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -28,6 +29,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "file.open.file-stream.write.written-bytes")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOfile$EOopen$EOfile_stream$EOwrite$EOwritten_bytes
extends PhDefault
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.eolang.Atom;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -25,6 +26,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "file.open.process-file")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOfile$EOopen$EOprocess_file extends PhDefault implements Atom {

Expand Down
2 changes: 2 additions & 0 deletions eo-runtime/src/main/java/org/eolang/EOfs/EOfile$EOsize.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.eolang.Atom;
import org.eolang.Data;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -23,6 +24,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "file.size")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOfile$EOsize extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import java.nio.file.Paths;
import org.eolang.Atom;
import org.eolang.Dataized;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -24,6 +25,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "file.touched.touch")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOfile$EOtouched$EOtouch extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @checkstyle TypeNameCheck (5 lines)
*/
@XmirObject(oname = "malloc.of.allocated.read")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOmalloc$EOof$EOallocated$EOread extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @checkstyle TypeNameCheck (5 lines)
*/
@XmirObject(oname = "malloc.of.allocated.resized")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOmalloc$EOof$EOallocated$EOresized extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @checkstyle TypeNameCheck (5 lines)
*/
@XmirObject(oname = "malloc.of.allocated.size")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOmalloc$EOof$EOallocated$EOsize extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @checkstyle TypeNameCheck (5 lines)
*/
@XmirObject(oname = "malloc.of.allocated.write")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOmalloc$EOof$EOallocated$EOwrite extends PhDefault implements Atom {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* @checkstyle TypeNameCheck (5 lines)
*/
@XmirObject(oname = "malloc.of.@")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOmalloc$EOof$EOφ extends PhDefault implements Atom {

Expand Down
2 changes: 2 additions & 0 deletions eo-runtime/src/main/java/org/eolang/EOsm/EOos$EOname.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import org.eolang.Atom;
import org.eolang.Data;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -21,6 +22,7 @@
* @checkstyle TypeNameCheck (5 lines)
*/
@XmirObject(oname = "os.name")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOos$EOname extends PhDefault implements Atom {

Expand Down
2 changes: 2 additions & 0 deletions eo-runtime/src/main/java/org/eolang/EOsm/EOposix$EOφ.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import org.eolang.EOsm.Posix.StrerrorSyscall;
import org.eolang.EOsm.Posix.WriteSyscall;
import org.eolang.ExFailure;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -40,6 +41,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "posix.@")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOposix$EOφ extends PhDefault implements Atom {

Expand Down
2 changes: 2 additions & 0 deletions eo-runtime/src/main/java/org/eolang/EOsm/EOwin32$EOφ.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.eolang.EOsm.Win32.WSAStartupFuncCall;
import org.eolang.EOsm.Win32.WriteFileFuncCall;
import org.eolang.ExFailure;
import org.eolang.Impure;
import org.eolang.PhDefault;
import org.eolang.Phi;
import org.eolang.XmirObject;
Expand All @@ -41,6 +42,7 @@
* @checkstyle TypeNameCheck (100 lines)
*/
@XmirObject(oname = "win32.@")
@Impure
@SuppressWarnings("PMD.AvoidDollarSigns")
public final class EOwin32$EOφ extends PhDefault implements Atom {

Expand Down
26 changes: 26 additions & 0 deletions eo-runtime/src/main/java/org/eolang/Impure.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2016-2026 Objectionary.com
* SPDX-License-Identifier: MIT
*/

package org.eolang;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
* Marks an atom whose result depends on the outside world.
*
* <p>An impure atom (file access, the operating system, the clock, randomness)
* yields a different object every time it is calculated. Its φ-expression is
* therefore not a reliable cache key, so caching decorators such as
* {@code PhSticky} must never memoize it.</p>
*
* @since 0.60
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface Impure {
}
Loading