Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
objetos con metodo y asignaciones infinitas
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
objeto :- write('{'), read(C),write('"'),write(C),write('"'), write(':'), valor(C), write('}'). cadena :- read(C),write('"'),write(C),write('"'). valor(M) :- read(T),(T='cadena'->cadena; T='numero'-> read(N),write(N); T='objeto'->objeto; T='metodo'->metodo(M); write('error'),write(T)). metodo(M) :- write('"function (){'),instruccion, write('return '), write(M), write(';}"'). instruccion :- read(T),(T='asignacion'->asignacion; T='decision'->decision; write('error'),write(T)). asignacion:- read(I),write(I),write('='),read(D),write(D),write(;), instruccion. decision :- write('esperame'). :- objeto.
obj1. objeto. obj2. objeto. obj3. objeto. obj4. metodo. asignacion. precio. 2500. decision.
[
-
]
Show input
Absolute running time: 0.32 sec, cpu time: 0.17 sec, memory peak: 7 Mb, absolute service time: 0,44 sec
edit mode
|
history
|
discussion
{"obj1":{"obj2":{"obj3":{"obj4":"function (){precio=2500;esperamereturn obj4;}"}}}}