RapLan

From Esolang
Jump to navigation Jump to search
RapLan
Paradigm(s) procedural, imperative
Designed by User:Phao
Appeared in 2023
Memory system variable-based
Dimensions one-dimensional
Computational class Unknown
Reference implementation Unimplemented
File extension(s) {{{files}}}

RapLan is a black language.

It was very black.

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119. (It will show in bold.)

All terms show in italic.

Terms

There is a table for all terms:

Term Interpretation
rap RapLan source code
say Run a rap.
replaceable Something like _*_ in a rap or a part of a rap.
replace table A table shows how to replace replaceables.
name An identifier.
shortname An abbr of a name.
basketball Jump to another position in the rap.
frame A target for a basketball.
throw Jump to a frame.

And if there is replaceables, then you can replace them.

Heading

A rap MUST start with this:

Hello everybody.
I'm practised 2.5 years, and my name is _name_.
I like singing, dancing, rapping, and playing basketball.
Music.
  • You MUST reserve all returns, times, and abbrs. You MUST NOT modify anything except replaceables.

Replace table:

Replaceable What will replace it
name Your name.

Or start with this:

J.N.T.M. by _name_

Replace table.

Replaceable What will replace it
name Your name.

Names

  • A valid name MUST start with J., and it end with J., too.
  • A valid name MUST only includes English letters, numbers, underscores and hyphens.

A valid name like J. chicken J., J. 114 J., and J. 114_514-cxk J..

And a invalid name like chicken (not start and end with J.), J. chicken (not end with J.), and chicken J. (not start with J.).

All names has a shortname. If a name is J. * J., then its shortname is *.

There is some name and theirs shortname.

Name Its shortname
J. chicken J. chicken
J. 114 J. 114
J. 114_154-cxk J. 114_514-cxk

You MUST NOT use shortnames in defines, and you can use shortnames in using name.

Variable

A variable must named using a name. If you will define a variable, you can use:

Hello, _name_.

Replace table:

Replaceable What will replace it
name The name of the variable. (not shortname!)

Is: (python)

_name_=0

You MUST NOT redefine a variable.

And if you want to remove a variable, then use:

Goodbye, _name_.

Replace table:

Replaceable What will replace it
name The name of the variable.

If you will set a variable to input, use:

What are you doing, baby _name_?

Replace table:

Replaceable What will replace it
name The name of the variable.

If you will increment a variable, use:

Chicken you're too beautiful, _name_

Replace table:

Replaceable What will replace it
name The name of the variable.

Is: (python)

_name_+=1

If you will decrement a variable, use:

Chicken you're really too beautiful, _name_

Replace table:

Replaceable What will replace it
name The name of the variable.

Is: (python)

_name_-=1

If you will output a variable's value as decimal, use:

What are you doing, _name_?

Replace table:

Replaceable What will replace it
name The name of the variable.

And if output its value as ASCII code, use:

What are you doing, andy _name_?

Replace table:

Replaceable What will replace it
name The name of the variable.

Conditions and basketballs

Basketballs like this:

(if _condition_ throw to _frame_)

Replace table:

Replaceable What will replace it
frame A frame which is the basketball throw to.
condition A condition check do it throw.

Or force jump:

(throw to _frame_)

Replace table:

Replaceable What will replace it
frame A frame which is the basketball throw to.

A condition like this:

Python Raplan
_a_ == _b_ _a_ is _b_
_a_ < _b_ _a_ is uglier than _b_
_a_ > _b_ _a_ is more beautiful than _b_
_a_ <= _b_ _a_ isn't more beautiful than _b_
_a_ >= _b_ _a_ isn't uglier than _b_
_a_ != _b_ _a_ isn't _b_

And a frame named _name_ is like this:

<pa>_name_<pa>

Replace table:

Replaceable What will replace it
name The name of the frame.

For an example, if it is a frame named 114, and it will throw to the frame if J. cxk J. is is less than J. xhz J., then the rap like this:

<pa>114<pa>
...
(if cxk is uglier than xhz throw to 114)

Constants

There are some constants:

Name Description Note
J. cxk J. Positive infinite Every greater than any things.
J. xhz J. Negative infinite Every less than any things.
J. gz J. NaN Can only check 'equal to' and 'not equal to'.
J. r J. ??? Only doesn't equal to J. gz J..

They don't need define and can't delete. You MUST NOT modify all constants except J. cxk J. and J. xhz J.

Errors

There is some errors.

Error:

Exception:What's your name?

Because the rap doesn't start with the start.

Error:

Exception:Who's he?

Because the variable doesn't inited.

Error:

Exception:He comed.

Because you redefined a variable.

Error:

Exception:gz dont beautiful.

Because J. gz J. can't compare with any other things.

Error:

Exception:Where's the frame?

Because there isn't a frame you throwing.

Error:

Exception:What are you doing?

Because there is a invalid command.